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

Abstract + using causes methods to apply to the Concrete type. #5888

Closed
m22spencer opened this issue Dec 16, 2016 · 2 comments
Closed

Abstract + using causes methods to apply to the Concrete type. #5888

m22spencer opened this issue Dec 16, 2016 · 2 comments
Assignees
Milestone

Comments

@m22spencer
Copy link
Contributor

When using an abstract, any non-static methods will apply to the concrete type, even if there is no valid from/@:from.

http://try.haxe.org/#5C204

using Test;

class Test {
    static function main() {
        0.bar();   //Should not compile.
    }
}

abstract Foo(Int) {
    public function bar() {};
}

Tested on: Haxe Compiler 3.4.0 (git build development @ fd22bf5)

@m22spencer m22spencer changed the title Abstract + using causes methods apply to the Concrete type. Abstract + using causes methods to apply to the Concrete type. Dec 16, 2016
@Simn Simn self-assigned this Dec 18, 2016
@Simn Simn added this to the 4.0 milestone Dec 18, 2016
@Simn
Copy link
Member

Simn commented Dec 18, 2016

Hmm yes, I suppose we should ignore non-static abstract functions here.

@Simn Simn modified the milestones: 3.4, 4.0 Jan 5, 2017
@Simn
Copy link
Member

Simn commented Jan 5, 2017

I'll fix this for 3.4 because it's easy to fix and could cause some problems that are hard to understand for peasants.

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

2 participants