-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Change order of override error checks #9187
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, and thank you for opening this PR! 🎉
All contributors have signed the CLA, thank you! ❤️
Have an awesome day! ☀️
@@ -143,6 +143,7 @@ object RefChecks { | |||
* | |||
* 1.1. M must have the same or stronger access privileges as O. | |||
* 1.2. O must not be effectively final. | |||
* 1.9.2 If M or O are extension methods, they must both be extension methods. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't think about if it makes sense in relation to the other checks.
Unless there are tests or those numbers (1.9.2
) have some order meaning. I did not saw any expressed logic for the order.
Restrictions between the order of check should be documented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ordering is just a notational device to align the coment and the code. We should change it to the new status.
So:
1.9.2 --> 1.3
1.3 --> 1.4
1.4 --> 1.5
1.9.1 --> 1.9
We can keep it at that since 1.5 is currently unused.
4756ac2
to
d4835fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
@@ -143,6 +143,7 @@ object RefChecks { | |||
* | |||
* 1.1. M must have the same or stronger access privileges as O. | |||
* 1.2. O must not be effectively final. | |||
* 1.9.2 If M or O are extension methods, they must both be extension methods. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ordering is just a notational device to align the coment and the code. We should change it to the new status.
So:
1.9.2 --> 1.3
1.3 --> 1.4
1.4 --> 1.5
1.9.1 --> 1.9
We can keep it at that since 1.5 is currently unused.
@@ -143,6 +143,8 @@ object RefChecks { | |||
* | |||
* 1.1. M must have the same or stronger access privileges as O. | |||
* 1.2. O must not be effectively final. | |||
* 1.9.2 If M or O are extension methods, they must both be extension methods. | |||
* (Should be before the check for the need of `override` modifier.) | |||
* 1.3. O is deferred, or M has `override` modifier. | |||
* 1.4. If O is stable, then so is M. | |||
* // @M: LIFTED 1.5. Neither M nor O are a parameterized type alias |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment is out of date, can be dropped.
The error check that is not possible to override an extension/normal methods, because it should be as declared. Shound come before the check that the `override` modifier is needed. Add test case for this: 'override-extension_normal-methods'
d4835fa
to
6beb516
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick update!
The error check that is not possible to override an extension/normal
methods, because it should be as declared. Should come before the check
that the
override
modifier is needed.Example of what the PR is trying to improve:
On the code above we will have the error:
Just to discover after adding the
override
modifier that: