-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Missing override errors on name collisions and default values #27476
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
Tagging as potential 1.20 blocker |
Isn't the first case correct? |
/cc @lrhn |
You don't inherit static members, but for some, probably very good, reason the specification does prohibit declaring an instance method with the same name as a static method of a superclass. Section 10.1:
Here "accessible" isn't really necessary, If it's not accessible, then it's a private from another library, and then it won't have the same /name/ as any declaration in the current library. Not a high priority problem to not warn about this particular thing. |
Removing blocking 1.20 tag and lowering to P2. |
Yeah I don't think it's a blocker, but great catch though. |
this still repros, and neither the CFE nor Analyzer report it. |
Note that the first example is now permitted by the spec. |
The second example now has a warning reported by the analyzer:
I think this was fixed with the Summary2 work. |
Analyzer has stopped report errors (in a strong mode) in many cases. A couple of examples:
Output:
analyzer 1.20.0-dev.10.0 strong mode:
No issues found
analyzer 1.20.0-dev.10.0 nostrong mode:
[warning] 'f' collides with a static member in the superclass 'A'
[warning] 'f' collides with a static member in the superclass 'A'
analyzer 1.19.1 strong mode:
[error] 'f' collides with a static member in the superclass 'A'
[error] 'f' collides with a static member in the superclass 'A'
Another example
Output:
analyzer 1.20.0-dev.10.0 strong mode:
No issues found
analyzer 1.20.0-dev.10.0 nostrong mode:
[warning] Parameters cannot override default values, this method overrides 'A.foo' where this positional parameter has a different value
analyzer 1.19.1 strong mode:
[error] Parameters cannot override default values, this method overrides 'A.foo' where this positional parameter has a different value
The text was updated successfully, but these errors were encountered: