File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -149,18 +149,20 @@ object Inliner {
149149
150150 /** Replace `Inlined` node by a block that contains its bindings and expansion */
151151 def dropInlined (inlined : tpd.Inlined )(implicit ctx : Context ): Tree = {
152- if (enclosingInlineds.nonEmpty) inlined // remove in the outer inlined call
152+ if (enclosingInlineds.nonEmpty) inlined // Remove in the outer most inlined call
153153 else {
154+ /** Removes all Inlined trees, replacing them with blocks.
155+ * Repositions all trees directly inside an inlined expantion of a non empty call to the position of the call.
156+ * Any tree directly inside an empty call (inlined in the inlined code) retains their position.
157+ */
154158 class Reposition extends TreeMap {
155159 override def transform (tree : Tree )(implicit ctx : Context ): Tree = {
156160 tree match {
157161 case tree : Inlined => transformInline(tree)
158162 case _ =>
159163 val transformed = super .transform(tree)
160164 enclosingInlineds match {
161- case call :: _ if ! call.isEmpty =>
162- // This tree was inlined and will have the position of the call that was inlined
163- transformed.withPos(call.pos)
165+ case call :: _ if ! call.isEmpty => transformed.withPos(call.pos)
164166 case _ => transformed
165167 }
166168 }
You can’t perform that action at this time.
0 commit comments