@@ -340,7 +340,6 @@ object RefChecks {
340
340
* of class `clazz` are met.
341
341
*/
342
342
def checkOverride (checkSubType : (Type , Type ) => Context ?=> Boolean , member : Symbol , other : Symbol ): Unit =
343
- def overridesInlineTraitMember = other.owner.ownersIterator.exists(_.isInlineTrait) && member.is(Synthetic )
344
343
def isInlinedFromInlineTrait = other.owner.isAllOf(InlineTrait ) && member.is(Synthetic )
345
344
346
345
def memberTp (self : Type ) =
@@ -418,7 +417,7 @@ object RefChecks {
418
417
419
418
def overrideTargetNameError () =
420
419
val otherTargetName = i " @targetName( ${other.targetName}) "
421
- if ! overridesInlineTraitMember then
420
+ if ! isInlinedFromInlineTrait then
422
421
if member.hasTargetName(member.name) then
423
422
overrideError(i " misses a target name annotation $otherTargetName" )
424
423
else if other.hasTargetName(other.name) then
@@ -463,13 +462,13 @@ object RefChecks {
463
462
// direct overrides were already checked on completion (see Checking.chckWellFormed)
464
463
// the test here catches indirect overriddes between two inherited base types.
465
464
overrideError(" cannot be used here - class definitions cannot be overridden" )
466
- else if (other.isOpaqueAlias)
465
+ else if (other.isOpaqueAlias && ! isInlinedFromInlineTrait )
467
466
// direct overrides were already checked on completion (see Checking.chckWellFormed)
468
467
// the test here catches indirect overriddes between two inherited base types.
469
468
overrideError(" cannot be used here - opaque type aliases cannot be overridden" )
470
469
else if (! other.is(Deferred ) && member.isClass)
471
470
overrideError(" cannot be used here - classes can only override abstract types" )
472
- else if (other.isEffectivelyFinal && ! overridesInlineTraitMember ) then // (1.2)
471
+ else if (other.isEffectivelyFinal && ! isInlinedFromInlineTrait ) then // (1.2)
473
472
overrideError(i " cannot override final member ${other.showLocated}" )
474
473
else if (member.is(ExtensionMethod ) && ! other.is(ExtensionMethod )) // (1.3)
475
474
overrideError(" is an extension method, cannot override a normal method" )
0 commit comments