@@ -1962,7 +1962,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
19621962 completeTypeTree(InferredTypeTree (), pt, tree)
19631963
19641964 def typedSingletonTypeTree (tree : untpd.SingletonTypeTree )(using Context ): SingletonTypeTree = {
1965- val ref1 = typedExpr(tree.ref)
1965+ val ref1 = typedExpr(tree.ref, SingletonTypeProto )
19661966 checkStable(ref1.tpe, tree.srcPos, " singleton type" )
19671967 assignType(cpy.SingletonTypeTree (tree)(ref1), ref1)
19681968 }
@@ -3773,20 +3773,20 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
37733773 true
37743774 }
37753775
3776- if ((implicitFun || caseCompanion) &&
3777- ! isApplyProto(pt) &&
3778- pt != AssignProto &&
3779- ! ctx.mode.is(Mode .Pattern ) &&
3780- ! ctx.isAfterTyper &&
3781- ! ctx.isInlineContext) {
3776+ if (implicitFun || caseCompanion)
3777+ && ! isApplyProto(pt)
3778+ && pt != SingletonTypeProto
3779+ && pt != AssignProto
3780+ && ! ctx.mode.is(Mode .Pattern )
3781+ && ! ctx.isAfterTyper
3782+ && ! ctx.isInlineContext
3783+ then
37823784 typr.println(i " insert apply on implicit $tree" )
37833785 val sel = untpd.Select (untpd.TypedSplice (tree), nme.apply).withAttachment(InsertedApply , ())
37843786 try typed(sel, pt, locked) finally sel.removeAttachment(InsertedApply )
3785- }
3786- else if (ctx.mode is Mode .Pattern ) {
3787+ else if ctx.mode is Mode .Pattern then
37873788 checkEqualityEvidence(tree, pt)
37883789 tree
3789- }
37903790 else
37913791 val meth = methPart(tree).symbol
37923792 if meth.isAllOf(DeferredInline ) && ! Inlines .inInlineMethod then
0 commit comments