@@ -84,6 +84,14 @@ object Typer {
84
84
*/
85
85
private [typer] val HiddenSearchFailure = new Property .Key [List [SearchFailure ]]
86
86
87
+ /** Is tree a compiler-generated `.apply` node that refers to the
88
+ * apply of a function class?
89
+ */
90
+ private [typer] def isSyntheticApply (tree : tpd.Tree ): Boolean = tree match {
91
+ case tree : tpd.Select => tree.hasAttachment(InsertedApply )
92
+ case _ => false
93
+ }
94
+
87
95
/** Add `fail` to the list of search failures attached to `tree` */
88
96
def rememberSearchFailure (tree : tpd.Tree , fail : SearchFailure ) =
89
97
tree.putAttachment(HiddenSearchFailure ,
@@ -2843,11 +2851,6 @@ class Typer extends Namer
2843
2851
case _ => false
2844
2852
}
2845
2853
2846
- def isSyntheticApply (tree : Tree ): Boolean = tree match {
2847
- case tree : Select => tree.hasAttachment(InsertedApply )
2848
- case _ => false
2849
- }
2850
-
2851
2854
def tryApply (using Context ) = {
2852
2855
val pt1 = pt.withContext(ctx)
2853
2856
val sel = typedSelect(untpd.Select (untpd.TypedSplice (tree), nme.apply), pt1)
@@ -3281,7 +3284,8 @@ class Typer extends Namer
3281
3284
! ctx.isAfterTyper &&
3282
3285
! ctx.isInlineContext) {
3283
3286
typr.println(i " insert apply on implicit $tree" )
3284
- typed(untpd.Select (untpd.TypedSplice (tree), nme.apply), pt, locked)
3287
+ val sel = untpd.Select (untpd.TypedSplice (tree), nme.apply).withAttachment(InsertedApply , ())
3288
+ try typed(sel, pt, locked) finally sel.removeAttachment(InsertedApply )
3285
3289
}
3286
3290
else if (ctx.mode is Mode .Pattern ) {
3287
3291
checkEqualityEvidence(tree, pt)
0 commit comments