-
Notifications
You must be signed in to change notification settings - Fork 34
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
Default type argument is not checked #961
Comments
Note that this is a typechecker bug, not a spec oversight: The spec clearly states that
|
@lucaswerkmeister I am unsure if I understand you correctly. My assumption is that it is not currently checked, because it passes. It plainly does not make nay sense not to check it. So it would be an oversight or a bug - I just assumed the spec contains this simple corollary. Then, as far as I know, this repo contains the typechecker, so this seems the right place. Anything wrong? |
No, everything is correct. I just wanted to clarify that is a pure bug, and not something that was forgotten in the textual specification. |
Sure, thanks for making up for my brevity! |
Looks like a bug, thanks! |
Some more info: class K<T=Integer>()
given T satisfies String {
}
void run() {
K k1 = nothing; // well-typed, and the IDE says it is indeed a K<Integer>
K<Integer> k2 = nothing; // error: Integer not assignable to upper bound String
K k3 = K(); // error: K<Nothing> not assignable to K<Integer> – this error vanishes if you declare T as out
} Note especially |
Fixed by @928061f. |
This passes the type checker:
But you cannot do much without assigning some legal type to
Representation
.The text was updated successfully, but these errors were encountered: