-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Mixins and the applyMixins function? #3505
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
Comments
Are you asking why the current behavior is this? class Foo {
doStuff() { return 'hi'; }
}
class Bar implements Foo { // error here, but should automatically mixin doStuff?
} |
I think the question is, why can't we do this:
Currently we do:
class Bar extends Foo implements Yung { I think @blendsdk is asking why you can't extend two classes, and the compiler emit the |
Because the type system is structural the At this point changing the behavior of these statements would be an enormous breaking change so it's not something we'd do without new syntax of some sort. |
@danquirk thanks for the note. I get changing the behaviour of |
Hi,
Since the compiler can distinguish between a class being used as an interface, what is the reason the compiler does not automatically emit "applyMixins" at the end of the compilation cycle? It there a particular reason for this?
Regards,
Gevik.
The text was updated successfully, but these errors were encountered: