Git Product home page Git Product logo

Comments (7)

clemos avatar clemos commented on August 30, 2024

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.

clemos avatar clemos commented on August 30, 2024

Ok I've managed to reproduce, it's due to -dce full...

from try-haxe.

clemos avatar clemos commented on August 30, 2024

Best option would be to expose the dce flag in the GUI,
but it's not planned right now :S

from try-haxe.

anissen avatar anissen commented on August 30, 2024

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:
myscreenshotname 2014-06-06 at 12 04 17 pm

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.

clemos avatar clemos commented on August 30, 2024

In any case, it's an haxe compiler issue now ;)

from try-haxe.

clemos avatar clemos commented on August 30, 2024

Closing the issue, feel free to reopen if needed

from try-haxe.

anissen avatar anissen commented on August 30, 2024

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)

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.