@@ -96,15 +96,6 @@ object Inliner:
96
96
}
97
97
end isElideableExpr
98
98
99
- // InlineCopier is a more fault-tolerant copier that does not cause errors when
100
- // function types in applications are undefined. This is necessary since we copy at
101
- // the same time as establishing the proper context in which the copied tree should
102
- // be evaluated. This matters for opaque types, see neg/i14653.scala.
103
- private class InlineCopier () extends TypedTreeCopier :
104
- override def Apply (tree : Tree )(fun : Tree , args : List [Tree ])(using Context ): Apply =
105
- if fun.tpe.widen.exists then super .Apply (tree)(fun, args)
106
- else untpd.cpy.Apply (tree)(fun, args).withTypeUnchecked(tree.tpe)
107
-
108
99
// InlinerMap is a TreeTypeMap with special treatment for inlined arguments:
109
100
// They are generally left alone (not mapped further, and if they wrap a type
110
101
// the type Inlined wrapper gets dropped
@@ -116,7 +107,13 @@ object Inliner:
116
107
substFrom : List [Symbol ],
117
108
substTo : List [Symbol ])(using Context )
118
109
extends TreeTypeMap (
119
- typeMap, treeMap, oldOwners, newOwners, substFrom, substTo, InlineCopier ()):
110
+ typeMap, treeMap, oldOwners, newOwners, substFrom, substTo,
111
+ // It is necessary to use the `ConservativeTreeCopier` since we copy at
112
+ // the same time as establishing the proper context in which the copied
113
+ // tree should be evaluated. This matters for opaque types, see
114
+ // neg/i14653.scala.
115
+ ConservativeTreeCopier ()
116
+ ):
120
117
121
118
override def copy (
122
119
typeMap : Type => Type ,
0 commit comments