@@ -143,6 +143,7 @@ object RefChecks {
143
143
*
144
144
* 1.1. M must have the same or stronger access privileges as O.
145
145
* 1.2. O must not be effectively final.
146
+ * 1.9.2 If M or O are extension methods, they must both be extension methods.
146
147
* 1.3. O is deferred, or M has `override` modifier.
147
148
* 1.4. If O is stable, then so is M.
148
149
* // @M: LIFTED 1.5. Neither M nor O are a parameterized type alias
@@ -157,7 +158,6 @@ object RefChecks {
157
158
* 1.8.2 M is of type []S, O is of type ()T and S <: T, or
158
159
* 1.8.3 M is of type ()S, O is of type []T and S <: T, or
159
160
* 1.9.1 If M is erased, O is erased. If O is erased, M is erased or inline.
160
- * 1.9.2 If M or O are extension methods, they must both be extension methods.
161
161
* 1.10. If O is inline (and deferred, otherwise O would be final), M must be inline
162
162
* 1.11. If O is a Scala-2 macro, M must be a Scala-2 macro.
163
163
* 2. Check that only abstract classes have deferred members
@@ -343,6 +343,10 @@ object RefChecks {
343
343
overrideError(" cannot be used here - classes can only override abstract types" )
344
344
else if (other.isEffectivelyFinal) // (1.2)
345
345
overrideError(i " cannot override final member ${other.showLocated}" )
346
+ else if (member.isAllOf(ExtensionMethod ) && ! other.isAllOf(ExtensionMethod )) // (1.9.2)
347
+ overrideError(" is an extension method, cannot override a normal method" )
348
+ else if (other.isAllOf(ExtensionMethod ) && ! member.isAllOf(ExtensionMethod )) // (1.9.2)
349
+ overrideError(" is a normal method, cannot override an extension method" )
346
350
else if (! other.is(Deferred ) &&
347
351
! other.name.is(DefaultGetterName ) &&
348
352
! member.isAnyOverride)
@@ -394,10 +398,6 @@ object RefChecks {
394
398
overrideError(" is erased, cannot override non-erased member" )
395
399
else if (other.is(Erased ) && ! member.isOneOf(Erased | Inline )) // (1.9.1)
396
400
overrideError(" is not erased, cannot override erased member" )
397
- else if (member.isAllOf(ExtensionMethod ) && ! other.isAllOf(ExtensionMethod )) // (1.9.2)
398
- overrideError(" is an extension method, cannot override a normal method" )
399
- else if (other.isAllOf(ExtensionMethod ) && ! member.isAllOf(ExtensionMethod )) // (1.9.2)
400
- overrideError(" is a normal method, cannot override an extension method" )
401
401
else if other.is(Inline ) && ! member.is(Inline ) then // (1.10)
402
402
overrideError(" is not inline, cannot implement an inline method" )
403
403
else if (other.isScala2Macro && ! member.isScala2Macro) // (1.11)
0 commit comments