Giter Club home page Giter Club logo

Comments (2)

0b1kn00b avatar 0b1kn00b commented on August 17, 2024

currentPos produces a Position which is opaque to the macro execution environment and can cause havoc if you try and construct one.

Position is part of the AST and separate and distinct from haxe.PosInfos which is only available in a runtime environment.

The try.haxe link is showing

Macro.hx:4: #pos(Test.hx:2: characters 1-8)

from haxe.

filt3rek avatar filt3rek commented on August 17, 2024

Sorry, I've given wrong url to try haxe for error, this is the correct one : https://try.haxe.org/#DeBb38Fb :

Compiler failure
Please submit an issue at https://github.com/HaxeFoundation/haxe/issues/new
Attach the following information:
Haxe: 4.3.4; OS type: unix;
File "src/typing/macroContext.ml", line 778, characters 18-25
Called from file "src/typing/macroContext.ml", line 778, characters 11-25
Called from file "list.ml", line 131, characters 32-39
Called from file "src/typing/macroContext.ml", line 772, characters 2-772
Called from file "src/typing/typeloadFields.ml", line 494, characters 16-45
Called from file "list.ml", line 110, characters 12-15
Called from file "src/typing/typeloadFields.ml", line 544, characters 1-44
Called from file "src/typing/typeloadFields.ml", line 742, characters 1-362
Called from file "src/typing/typeloadFields.ml", line 1740, characters 14-46
Called from file "src/typing/typeloadModule.ml", line 423, characters 5-70
Called from file "src/typing/typeloadModule.ml", line 454, characters 40-54
Called from file "src/context/typecore.ml", line 407, characters 3-6
Called from file "src/typing/finalization.ml", line 83, characters 1-30
Called from file "src/compiler/compiler.ml", line 278, characters 1-269
Called from file "src/compiler/compiler.ml", line 328, characters 3-24
Called from file "src/compiler/compiler.ml", line 354, characters 1-5
Called from file "src/compiler/compiler.ml", line 441, characters 2-157
Called from file "src/compiler/compiler.ml", line 415, characters 2-9
Called from file "src/compiler/compiler.ml", line 637, characters 5-43
Called from file "src/compiler/compiler.ml", line 647, characters 13-22
Called from file "src/compiler/server.ml", line 979, characters 1-39
[ERROR] (unknown position)

   | File "src/core/globals.ml", line 156, characters 1-7: Assertion failed

And ok, but I throwed this issue just to maybe uniform the behaviour because i.e. for init macro, haxe.PosInfos is kind of working giving me {methodName: toString, fileName: --macro Macro.test(), className: , lineNumber: 1} so it's not only working for runtime whereas haxe.macro.Context.currentPos() gives #pos((unknown)) in init macro...

from haxe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.