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

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

Projects

None yet

2 participants

@m22spencer
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 from Abstract + using causes methods apply to the Concrete type. to 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
Member
Simn commented Dec 18, 2016

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

@Simn Simn modified the milestone: 3.4, 4.0 Jan 5, 2017
@Simn
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.

@Simn Simn closed this in 9dc9a7a Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment