diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-07-21 23:34:53 -0700 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-07-21 23:34:53 -0700 |
commit | fc4b464faeb43c3e2917b11a95c4f84481c443f7 (patch) | |
tree | 2e105d3a0c3374875bede127dd6afaf7a1c88715 /src/compiler | |
parent | 2247593472031fd9712b652bab0b978a788e46ef (diff) | |
parent | ef979c02da887b7c56bc1da9c4eb888e92af570f (diff) | |
download | scala-fc4b464faeb43c3e2917b11a95c4f84481c443f7.tar.gz scala-fc4b464faeb43c3e2917b11a95c4f84481c443f7.tar.bz2 scala-fc4b464faeb43c3e2917b11a95c4f84481c443f7.zip |
Merge pull request #2730 from scalamacros/ticket/7657
SI-7657 clarifies the "macro overrides method" rule
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index 03ce710700..9c374e85ea 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -225,7 +225,7 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans * 1.8.1 M's type is a subtype of O's type, or * 1.8.2 M is of type []S, O is of type ()T and S <: T, or * 1.8.3 M is of type ()S, O is of type []T and S <: T, or - * 1.9. If M is a macro def, O cannot be deferred. + * 1.9. If M is a macro def, O cannot be deferred unless there's a concrete method overriding O. * 1.10. If M is not a macro def, O cannot be a macro def. * 2. Check that only abstract classes have deferred members * 3. Check that concrete classes do not have deferred definitions @@ -417,7 +417,7 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans } else if (other.isValue && other.isLazy && !other.isSourceMethod && !other.isDeferred && member.isValue && !member.isLazy) { overrideError("must be declared lazy to override a concrete lazy value") - } else if (other.isDeferred && member.isTermMacro) { // (1.9) + } else if (other.isDeferred && member.isTermMacro && member.extendedOverriddenSymbols.forall(_.isDeferred)) { // (1.9) overrideError("cannot override an abstract method") } else if (other.isTermMacro && !member.isTermMacro) { // (1.10) overrideError("cannot override a macro") |