Comments (2)
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.
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)
- [optimisation] For loop is not removed if variable is used
- Eval compiler exception when building hxb HOT 2
- Map with abstract key complains about mismatched types HOT 1
- Diagnostics prevents macros from being updated
- Null-coalescing operator cast before test against null issue HOT 2
- [diagnostics] No diagnostics returns empty string instead of json rpc response HOT 1
- Compilation server gives different result on 1st/2nd compilation HOT 1
- Diagnostic cause compiler failure Unbound variable src/filters/renameVars.ml
- Compiler can't write to long paths on Windows, even with long paths enabled HOT 1
- Switch Abstract<Null<Int>> generation differ from Null<Int> HOT 6
- [hlc] Using unsigned shift right operator on Int64 results in code that does not compile on MSVC without manually including a particular header.
- local static in inlined function gets optimized away with analyzer HOT 5
- lix upgraded to 4.3.5 and haxelib throws an error HOT 4
- Abstract generate @:impliciteCast instead of cast in some situation, cause different behavior on HL
- AttributeError: 'os.stat_result' object has no attribute 'st_birthtime' on linux HOT 1
- Call stack missing type names on JS in Chrome HOT 1
- Invalid String Exception when inputting non-english text in interp mode (Sys.stdin().readLine)
- Confusing deprecation warning when using `--jvm out.jar` HOT 2
- Regression: extractor fails in non-exhaustive switch
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haxe.