Comments (7)
It's weird, looks like a bug in the compiler ?
Try-haxe compiles with -dce full
but I can't reproduce locally...
from try-haxe.
Ok I've managed to reproduce, it's due to -dce full
...
from try-haxe.
Best option would be to expose the dce flag in the GUI,
but it's not planned right now :S
from try-haxe.
A-ha, that's seems to be a clue! Compiling locally w. -dce full
gives an empty result on both Neko and JavaScript.
I've updated the sample to use the previously unused fields:
import haxe.rtti.Meta;
@author("Nicolas")
@debug
class MyClass {
@author("Nicolas")
@range(1, 8)
var value:Int;
public function new(v) { value = v; }
@broken
@:noCompletion
public static function method() { }
}
class Test {
static public function main() {
var c = new MyClass(42);
MyClass.method();
trace("Type");
trace(Meta.getType(MyClass)); // { author : ["Nicolas"], debug : null }
trace("Fields");
trace(Meta.getFields(MyClass)); // [1,8]
trace("Statics");
trace(Meta.getStatics(MyClass)); // { broken: null }
}
}
... and then the output is as expected:
It might be a "feature" rather than a "bug" but it's still pretty confusing. Maybe using haxe.rtti.Meta
should an error/warning when fields are being removed due to dead code elimination. Or better yet; make the given fields not be removed by DCE - although that might be impossible to determine if reflection is involved...
from try-haxe.
In any case, it's an haxe compiler issue now ;)
from try-haxe.
Closing the issue, feel free to reopen if needed
from try-haxe.
Yeah, I agree that it's a compiler issue.
It might be nice to simply list the compiler flags somewhere on try.haxe for information. I could have reproduced the problem immediately in the haxe compiler if I had known that the -dce full
flag was used.
Dunno, this instance might be a very edge-case-issue. Anyhow, thanks for your help :)
from try-haxe.
Related Issues (20)
- Haxe 3.4 HOT 1
- Please update compiler to 3.4.2 HOT 2
- Invalid reg exp for splitting source to line HOT 4
- Comment above 'class Test' causes build error HOT 2
- Site is down HOT 3
- TryHaxe doesnt work landscape on mobile HOT 2
- Update compiler to 3.4.4 HOT 1
- Updating libraries HOT 8
- Add tink_state to supported libraries HOT 2
- changes to make it work on haxe 4 HOT 2
- Add MVCoconut to extra libs
- try.haxe.org is currently unusable HOT 2
- Update to Haxe 3.4.7 HOT 1
- Update pixi.js lib to actual version
- NET::ERR_CERT_DATE_INVALID HOT 5
- Haxe 4 HOT 15
- Drop flash / add interp mode
- NET::ERR_CERT_DATE_INVALID
- Some love for the maintainer !❤️💙🚀 HOT 1
- security certificates expired? HOT 1
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 try-haxe.