@@ -156,7 +156,8 @@ object RefChecks {
156156 * 1.8.1 M's type is a subtype of O's type, or
157157 * 1.8.2 M is of type []S, O is of type ()T and S <: T, or
158158 * 1.8.3 M is of type ()S, O is of type []T and S <: T, or
159- * 1.9 If M or O are erased, they must be both erased
159+ * 1.9.1 If M or O are erased, they must both be erased
160+ * 1.9.2 If M or O are extension methods, they must both be extension methods
160161 * 1.10 If M is an inline or Scala-2 macro method, O cannot be deferred unless
161162 * there's also a concrete method that M overrides.
162163 * 1.11. If O is a Scala-2 macro, M must be a Scala-2 macro.
@@ -391,10 +392,14 @@ object RefChecks {
391392 overrideError(" may not override a non-lazy value" )
392393 } else if (other.is(Lazy ) && ! other.isRealMethod && ! member.is(Lazy )) {
393394 overrideError(" must be declared lazy to override a lazy value" )
394- } else if (member.is(Erased ) && ! other.is(Erased )) { // (1.9)
395+ } else if (member.is(Erased ) && ! other.is(Erased )) { // (1.9.1 )
395396 overrideError(" is erased, cannot override non-erased member" )
396- } else if (other.is(Erased ) && ! member.is(Erased )) { // (1.9)
397+ } else if (other.is(Erased ) && ! member.is(Erased )) { // (1.9.1 )
397398 overrideError(" is not erased, cannot override erased member" )
399+ } else if (member.is(Extension ) && ! other.is(Extension )) { // (1.9.2)
400+ overrideError(" is an extension method, cannot override a normal method" )
401+ } else if (other.is(Extension ) && ! member.is(Extension )) { // (1.9.2)
402+ overrideError(" is a normal method, cannot override an extension method" )
398403 } else if ((member.isInlineMethod || member.is(Scala2Macro )) && other.is(Deferred ) &&
399404 member.extendedOverriddenSymbols.forall(_.is(Deferred ))) { // (1.10)
400405 overrideError(" is an inline method, must override at least one concrete method" )
0 commit comments