Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static macro methods on @:generic classes #3766

Closed
Simn opened this issue Jan 18, 2015 · 0 comments
Closed

Static macro methods on @:generic classes #3766

Simn opened this issue Jan 18, 2015 · 0 comments
Assignees
Milestone

Comments

@Simn
Copy link
Member

Simn commented Jan 18, 2015

@:generic
class Main<T> {
    static function main() {
        new Main<String>();
    }

    function new() { }

    macro static function test() {
        return macro null;
    }
}

This currently errors with src/Main.hx:3: lines 3-5 : A generic class can't have static fields. For one the error position is off, but I don't really see why we have to disallow macros on @:generic classes in the first place.

This likely means using load_type_def instead of load_instance in load_macro, but that strikes me as the better approach anyway as we don't actually need a TInst there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant