-
Notifications
You must be signed in to change notification settings - Fork 21
Unsound subtyping behavior with (=> Any) #1386
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
Imported From: https://issues.scala-lang.org/browse/SI-1386?orig=1 |
@odersky said: |
Geoffrey Alan Washburn (washburn) said: Maybe you didn't look closely enough, but clearly the abstractions are getting violated because in the latter example myToString is receiving some kind of thunk rather than the integer 3 as its argument. |
Aaron Harnly (aaronharnly) said:
Eh? (=> Any) is a subtype of Any in the same sense that (=> Int) is a subtype of Any. |
Geoffrey Alan Washburn (washburn) said:
Indeed, I hadn't been thinking about the problem in that fashion. However, there is still the issue that the abstraction boundaries are getting violated. At least with respect the current description of by-name types/parameters in the specification. |
The following is correctly disallowed:
but at present this seems to work:
The text was updated successfully, but these errors were encountered: