@@ -143,16 +143,14 @@ object RefChecks {
143
143
* 1.8.1 M's type is a subtype of O's type, or
144
144
* 1.8.2 M is of type []S, O is of type ()T and S <: T, or
145
145
* 1.8.3 M is of type ()S, O is of type []T and S <: T, or
146
- * 1.9 M must not be an erased definition
147
- * 1.10. If M is a 2.x macro def, O cannot be deferred unless there's a concrete method overriding O.
148
- * 1.11. If M is not a macro def, O cannot be a macro def.
146
+ * 1.9 If M is an erased definition, it must override at least one concrete member
149
147
* 2. Check that only abstract classes have deferred members
150
148
* 3. Check that concrete classes do not have deferred definitions
151
149
* that are not implemented in a subclass.
152
150
* 4. Check that every member with an `override` modifier
153
151
* overrides some other member.
154
152
* TODO check that classes are not overridden
155
- * TODO This still needs to be cleaned up; the current version is a staright port of what was there
153
+ * TODO This still needs to be cleaned up; the current version is a straight port of what was there
156
154
* before, but it looks too complicated and method bodies are far too large.
157
155
*/
158
156
private def checkAllOverrides (clazz : Symbol )(implicit ctx : Context ): Unit = {
@@ -376,14 +374,8 @@ object RefChecks {
376
374
overrideError(" may not override a non-lazy value" )
377
375
} else if (other.is(Lazy ) && ! other.isRealMethod && ! member.is(Lazy )) {
378
376
overrideError(" must be declared lazy to override a lazy value" )
379
- } else if (member.is(Erased )) { // (1.9)
380
- overrideError(" is an erased method, may not override anything" )
381
- } else if (member.is(Macro , butNot = Scala2x )) { // (1.9)
382
- overrideError(" is a macro, may not override anything" )
383
- } else if (other.is(Deferred ) && member.is(Scala2Macro ) && member.extendedOverriddenSymbols.forall(_.is(Deferred ))) { // (1.10)
384
- overrideError(" cannot be used here - term macros cannot override abstract methods" )
385
- } else if (other.is(Macro ) && ! member.is(Macro )) { // (1.11)
386
- overrideError(" cannot be used here - only term macros can override term macros" )
377
+ } else if (member.is(Erased ) && other.is(Deferred ) && member.extendedOverriddenSymbols.forall(_.is(Deferred ))) { // (1.9)
378
+ overrideError(" is erased, cannot override only abstract methods" )
387
379
} else if (! compatibleTypes(memberTp(self), otherTp(self)) &&
388
380
! compatibleTypes(memberTp(upwardsSelf), otherTp(upwardsSelf))) {
389
381
overrideError(" has incompatible type" + err.whyNoMatchStr(memberTp(self), otherTp(self)))
0 commit comments