@@ -3346,25 +3346,23 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
3346
3346
// try an implicit conversion or given extension
3347
3347
if ctx.mode.is(Mode .ImplicitsEnabled ) && ! tree.name.isConstructorName && qual.tpe.isValueType then
3348
3348
try
3349
- trace(i " try insert impl on qualifier $tree $pt" ) {
3350
- val selProto = selectionProto
3351
- inferView(qual, selProto) match
3352
- case SearchSuccess (found, _, _, isExtension) =>
3353
- if isExtension then return found
3354
- else
3355
- checkImplicitConversionUseOK(found)
3356
- return withoutMode(Mode .ImplicitsEnabled )(typedSelect(tree, pt, found))
3357
- case failure : SearchFailure =>
3358
- if failure.isAmbiguous then
3359
- return
3360
- if ! inSelect // in a selection we will do the canDefineFurther afterwards
3361
- && canDefineFurther(qual.tpe.widen)
3362
- then
3363
- tryExtensionOrConversion(tree, pt, mbrProto, qual, locked, compat, inSelect)
3364
- else
3365
- err.typeMismatch(qual, selProto, failure.reason) // TODO: report NotAMember instead, but need to be aware of failure
3366
- rememberSearchFailure(qual, failure)
3367
- }
3349
+ val selProto = selectionProto
3350
+ trace(i " try insert impl on qualifier $tree $pt" ) { inferView(qual, selProto) } match
3351
+ case SearchSuccess (found, _, _, isExtension) =>
3352
+ if isExtension then return found
3353
+ else
3354
+ checkImplicitConversionUseOK(found)
3355
+ return withoutMode(Mode .ImplicitsEnabled )(typedSelect(tree, pt, found))
3356
+ case failure : SearchFailure =>
3357
+ if failure.isAmbiguous then
3358
+ return
3359
+ if ! inSelect // in a selection we will do the canDefineFurther afterwards
3360
+ && canDefineFurther(qual.tpe.widen)
3361
+ then
3362
+ tryExtensionOrConversion(tree, pt, mbrProto, qual, locked, compat, inSelect)
3363
+ else
3364
+ err.typeMismatch(qual, selProto, failure.reason) // TODO: report NotAMember instead, but need to be aware of failure
3365
+ rememberSearchFailure(qual, failure)
3368
3366
catch case ex : TypeError => nestedFailure(ex)
3369
3367
3370
3368
EmptyTree
0 commit comments