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

Structural subtyping + abstracts #2822

Closed
Herschel opened this issue Mar 28, 2014 · 3 comments
Closed

Structural subtyping + abstracts #2822

Herschel opened this issue Mar 28, 2014 · 3 comments

Comments

@Herschel
Copy link
Contributor

Herschel commented Mar 28, 2014

This fails with MyAbstract should be MyType and MyAbstract should be { foo : Void -> Void }:

abstract MyAbstract(Int)
{
    public function new()
    {

    }

    public function foo()
        trace( "Foo" );
}


typedef MyType = { function foo() : Void; };

class Main {
  static function main(){
    var a : MyType = new MyAbstract();
  }
}
@Simn
Copy link
Member

Simn commented Mar 28, 2014

I think that's correct, I can't see how we would resolve the anon field access to a static abstract field.

@Herschel
Copy link
Contributor Author

Yea, I guess this is impossible.

@Simn
Copy link
Member

Simn commented Mar 28, 2014

Sorry. :)

@Simn Simn closed this as completed Mar 28, 2014
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