diff --git a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala index 1006044e851d..fea74f99beb1 100644 --- a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala +++ b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala @@ -1180,7 +1180,7 @@ object RefChecks { def targetOfHiddenExtension: Symbol = val target = val target0 = explicitInfo.firstParamTypes.head // required for extension method, the putative receiver - target0.dealiasKeepOpaques.typeSymbol.info + target0.dealiasKeepOpaques.typeSymbol.info.hiBound val member = target.nonPrivateMember(sym.name) .filterWithPredicate: member => member.symbol.isPublic && memberHidesMethod(member) diff --git a/tests/warn/i23293.scala b/tests/warn/i23293.scala new file mode 100644 index 000000000000..10e1a7865c6b --- /dev/null +++ b/tests/warn/i23293.scala @@ -0,0 +1,4 @@ + +trait SelectByName[Field <: String & Singleton, Rec <: Tuple]: + type Out + extension (r: Rec) def apply[F <: Field]: Out // warn not crash