SD-128 fix override checks for default methods#5331
Merged
adriaanm merged 1 commit intoscala:2.12.xfrom Aug 13, 2016
Merged
Conversation
The check for inheriting two conflicting members was wrong for default
methods, leading to a missing error message.
We were also not issuing "needs `override' modifier" when overriding a
default method.
Removes two methods:
- `isDeferredOrJavaDefault` had a single use that is removed in this commit.
- `isDeferredNotJavaDefault` is redundant with `isDeferred`, because
no default method has the `DEFERRED` flag:
- For symbols originating in the classfile parser this was the case
from day one: default methods don't receive the `DEFERRED` flag.
Only abstract interface methods do, as they have the `JAVA_ACC_ABSTRACT`
flag in bytecode, which the classfile parser translates to `DEFERRED`.
- For symbols created by the Java source parser, we don't add the
`DEFERRED` to default methods anymore since 373db1e.
Fixes scala/scala-dev#128
Contributor
Author
|
LGTM :-) |
Contributor
Author
|
This will need a few follow ups, as discovered by the community build: https://scala-ci.typesafe.com/view/scala-2.12.x/job/scala-2.12.x-integrate-community-build/475/console |
16 tasks
adriaanm
added a commit
to adriaanm/akka
that referenced
this pull request
Aug 13, 2016
adriaanm
added a commit
to adriaanm/slick
that referenced
this pull request
Aug 13, 2016
adriaanm
added a commit
to adriaanm/scala-js
that referenced
this pull request
Aug 13, 2016
adriaanm
added a commit
to adriaanm/scala-js
that referenced
this pull request
Aug 23, 2016
patriknw
pushed a commit
to akka/akka-core
that referenced
this pull request
Aug 26, 2016
patriknw
added a commit
to akka/akka-core
that referenced
this pull request
Aug 26, 2016
add `override` for scala/scala#5331
szeiger
pushed a commit
to szeiger/slick
that referenced
this pull request
Sep 1, 2016
szeiger
added a commit
to slick/slick
that referenced
this pull request
Sep 1, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The check for inheriting two conflicting members was wrong for default
methods, leading to a missing error message.
We were also not issuing "needs `override' modifier" when overriding a
default method.
Removes two methods:
isDeferredOrJavaDefaulthad a single use that is removed in this commit.isDeferredNotJavaDefaultis redundant withisDeferred, becauseno default method has the
DEFERREDflag:from day one: default methods don't receive the
DEFERREDflag.Only abstract interface methods do, as they have the
JAVA_ACC_ABSTRACTflag in bytecode, which the classfile parser translates to
DEFERRED.DEFERREDto default methods anymore since 373db1e.Fixes scala/scala-dev#128