@@ -178,6 +178,11 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
178
178
}
179
179
}
180
180
181
+ private def handleInlineCall (sym : Symbol )(implicit ctx : Context ): Unit = {
182
+ if (sym.is(Inline ))
183
+ ctx.compilationUnit.containsQuotesOrSplices = true
184
+ }
185
+
181
186
private object dropInlines extends TreeMap {
182
187
override def transform (tree : Tree )(implicit ctx : Context ): Tree = tree match {
183
188
case Inlined (call, _, _) =>
@@ -189,12 +194,14 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
189
194
override def transform (tree : Tree )(implicit ctx : Context ): Tree =
190
195
try tree match {
191
196
case tree : Ident if ! tree.isType =>
197
+ handleInlineCall(tree.symbol)
192
198
handleMeta(tree.symbol)
193
199
tree.tpe match {
194
200
case tpe : ThisType => This (tpe.cls).withPos(tree.pos)
195
201
case _ => tree
196
202
}
197
203
case tree @ Select (qual, name) =>
204
+ handleInlineCall(tree.symbol)
198
205
handleMeta(tree.symbol)
199
206
if (name.isTypeName) {
200
207
Checking .checkRealizable(qual.tpe, qual.pos.focus)
@@ -236,19 +243,6 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
236
243
case _ =>
237
244
super .transform(tree1)
238
245
}
239
- case Inlined (call, bindings, expansion) if ! call.isEmpty =>
240
- // Leave only a call trace consisting of
241
- // - a reference to the top-level class from which the call was inlined,
242
- // - the call's position
243
- // in the call field of an Inlined node.
244
- // The trace has enough info to completely reconstruct positions.
245
- // The minimization is done for two reasons:
246
- // 1. To save space (calls might contain large inline arguments, which would otherwise
247
- // be duplicated
248
- // 2. To enable correct pickling (calls can share symbols with the inlined code, which
249
- // would trigger an assertion when pickling).
250
- val callTrace = Ident (call.symbol.topLevelClass.typeRef).withPos(call.pos)
251
- cpy.Inlined (tree)(callTrace, transformSub(bindings), transform(expansion)(inlineContext(call)))
252
246
case tree : Template =>
253
247
withNoCheckNews(tree.parents.flatMap(newPart)) {
254
248
val templ1 = paramFwd.forwardParamAccessors(tree)
0 commit comments