Skip to content

SD-128 fix override checks for default methods#5331

Merged
adriaanm merged 1 commit intoscala:2.12.xfrom
adriaanm:pr5282-reword
Aug 13, 2016
Merged

SD-128 fix override checks for default methods#5331
adriaanm merged 1 commit intoscala:2.12.xfrom
adriaanm:pr5282-reword

Conversation

@adriaanm
Copy link
Contributor

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

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
@scala-jenkins scala-jenkins added this to the 2.12.1 milestone Aug 13, 2016
@adriaanm adriaanm modified the milestones: 2.12.0-RC1, 2.12.1 Aug 13, 2016
@adriaanm
Copy link
Contributor Author

LGTM :-)

@adriaanm adriaanm merged commit 69c6500 into scala:2.12.x Aug 13, 2016
@adriaanm
Copy link
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

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
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
@adriaanm adriaanm added the 2.12 label Oct 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants