@@ -3304,25 +3304,23 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
3304
3304
// try an implicit conversion or given extension
3305
3305
if ctx.mode.is(Mode .ImplicitsEnabled ) && ! tree.name.isConstructorName && qual.tpe.isValueType then
3306
3306
try
3307
- trace(i " try insert impl on qualifier $tree $pt" ) {
3308
- val selProto = selectionProto
3309
- inferView(qual, selProto) match
3310
- case SearchSuccess (found, _, _, isExtension) =>
3311
- if isExtension then return found
3312
- else
3313
- checkImplicitConversionUseOK(found)
3314
- return withoutMode(Mode .ImplicitsEnabled )(typedSelect(tree, pt, found))
3315
- case failure : SearchFailure =>
3316
- if failure.isAmbiguous then
3317
- return
3318
- if ! inSelect // in a selection we will do the canDefineFurther afterwards
3319
- && canDefineFurther(qual.tpe.widen)
3320
- then
3321
- tryExtensionOrConversion(tree, pt, mbrProto, qual, locked, compat, inSelect)
3322
- else
3323
- err.typeMismatch(qual, selProto, failure.reason) // TODO: report NotAMember instead, but need to be aware of failure
3324
- rememberSearchFailure(qual, failure)
3325
- }
3307
+ val selProto = selectionProto
3308
+ trace(i " try insert impl on qualifier $tree $pt" ) { inferView(qual, selProto) } match
3309
+ case SearchSuccess (found, _, _, isExtension) =>
3310
+ if isExtension then return found
3311
+ else
3312
+ checkImplicitConversionUseOK(found)
3313
+ return withoutMode(Mode .ImplicitsEnabled )(typedSelect(tree, pt, found))
3314
+ case failure : SearchFailure =>
3315
+ if failure.isAmbiguous then
3316
+ return
3317
+ if ! inSelect // in a selection we will do the canDefineFurther afterwards
3318
+ && canDefineFurther(qual.tpe.widen)
3319
+ then
3320
+ tryExtensionOrConversion(tree, pt, mbrProto, qual, locked, compat, inSelect)
3321
+ else
3322
+ err.typeMismatch(qual, selProto, failure.reason) // TODO: report NotAMember instead, but need to be aware of failure
3323
+ rememberSearchFailure(qual, failure)
3326
3324
catch case ex : TypeError => nestedFailure(ex)
3327
3325
3328
3326
EmptyTree
0 commit comments