-
Notifications
You must be signed in to change notification settings - Fork 21
Compiler allows field to override empty-paren method (Type-safety problem) #3138
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-3138?orig=1
|
me (scalll) said: |
me (scalll) said: // Expected in relation to (1) but not to (3). |
@paulp said: (d: C).b() Hard to see what can be done about it, unless we follow through on treating java and scala members differently. Java no-argument methods all have parens so fields have to be able to override () methods. Personally I'm not convinced it represents a loss of type safety either -- something not compiling does not represent unsoundness. I'll leave it for martin & co to determine though. |
me (scalll) said: I'm almost sure this feature violates type-safety though if nothing is changed to the compiler. Now that I'm better informed, I posted a new ticket with a better definition of the problem. (#3144) Something not compiling does not represent unsoundness, I fully agree. |
me (scalll) said: |
The text was updated successfully, but these errors were encountered: