-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Override check does not account for match type. #7894
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
Match type
cannot be recognize in overrided method.Match type
cannot be recognized in overrided method.
Match type
cannot be recognized in overrided method.
This is as intended but needs to be specced. We need to have a clause that a method A overrides a method B only if both the original types and the erased types conform (or, alternatively, original types and signatures, if we want to talk about that). The erasure of a match type is the erasure of its upper bound, which would be |
Hum, aren't bridges supposed to relieve us from the necessity that erased types have to conform? Today we can override a def foo(x: T): Int with a def foo(x: Int): Int when the class' type parameter is instantiated to |
It's the signatures as seen from the subclass that matter here, not the erased types per se. Bridges
Together, this would mean we'd have to start from scratch and write another compiler. |
minimized code
expectation
I'm not sure if it is just the limitation of
Match Type
or a bug.The text was updated successfully, but these errors were encountered: