@@ -178,6 +178,11 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
178178 }
179179 }
180180
181+ private def handleInlineCall (sym : Symbol )(implicit ctx : Context ): Unit = {
182+ if (sym.is(Inline ))
183+ ctx.compilationUnit.containsQuotesOrSplices = true
184+ }
185+
181186 private object dropInlines extends TreeMap {
182187 override def transform (tree : Tree )(implicit ctx : Context ): Tree = tree match {
183188 case Inlined (call, _, _) =>
@@ -189,12 +194,14 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
189194 override def transform (tree : Tree )(implicit ctx : Context ): Tree =
190195 try tree match {
191196 case tree : Ident if ! tree.isType =>
197+ handleInlineCall(tree.symbol)
192198 handleMeta(tree.symbol)
193199 tree.tpe match {
194200 case tpe : ThisType => This (tpe.cls).withPos(tree.pos)
195201 case _ => tree
196202 }
197203 case tree @ Select (qual, name) =>
204+ handleInlineCall(tree.symbol)
198205 handleMeta(tree.symbol)
199206 if (name.isTypeName) {
200207 Checking .checkRealizable(qual.tpe, qual.pos.focus)
@@ -203,6 +210,7 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
203210 else
204211 transformSelect(tree, Nil )
205212 case tree : Apply =>
213+ handleInlineCall(tree.symbol)
206214 val methType = tree.fun.tpe.widen
207215 val app =
208216 if (methType.isErasedMethod)
@@ -223,6 +231,7 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
223231 super .transform(app)
224232 }
225233 case tree : TypeApply =>
234+ handleInlineCall(tree.symbol)
226235 val tree1 @ TypeApply (fn, args) = normalizeTypeArgs(tree)
227236 if (fn.symbol != defn.ChildAnnot .primaryConstructor) {
228237 // Make an exception for ChildAnnot, which should really have AnyKind bounds
@@ -236,19 +245,6 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
236245 case _ =>
237246 super .transform(tree1)
238247 }
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)))
252248 case tree : Template =>
253249 withNoCheckNews(tree.parents.flatMap(newPart)) {
254250 val templ1 = paramFwd.forwardParamAccessors(tree)
0 commit comments