File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,12 @@ trait MessageRendering {
15
15
def stripColor (str : String ): String =
16
16
str.replaceAll(" \u001B\\ [[;\\ d]*m" , " " )
17
17
18
+ def outer (pos : SourcePosition , prefix : String )(implicit ctx : Context ): List [String ] =
19
+ if (pos.outer.exists) {
20
+ s " $prefix| This location is in code that was inlined at ${pos.outer}" ::
21
+ outer(pos.outer, prefix)
22
+ } else Nil
23
+
18
24
def sourceLines (pos : SourcePosition )(implicit ctx : Context ): (List [String ], List [String ], Int ) = {
19
25
var maxLen = Int .MinValue
20
26
def render (xs : List [Int ]) =
@@ -92,7 +98,7 @@ trait MessageRendering {
92
98
val (srcBefore, srcAfter, offset) = sourceLines(pos)
93
99
val marker = columnMarker(pos, offset)
94
100
val err = errorMsg(pos, msg.msg, offset)
95
- sb.append((srcBefore ::: marker :: err :: srcAfter).mkString(" \n " ))
101
+ sb.append((srcBefore ::: marker :: err :: outer(pos, " " * (offset - 1 )) ::: srcAfter).mkString(" \n " ))
96
102
} else sb.append(msg.msg)
97
103
sb.toString
98
104
}
Original file line number Diff line number Diff line change @@ -236,10 +236,12 @@ object Inliner {
236
236
def inlineCall (tree : Tree , pt : Type )(implicit ctx : Context ): Tree =
237
237
if (enclosingInlineds.length < ctx.settings.xmaxInlines.value)
238
238
new Inliner (tree, bodyToInline(tree.symbol)).inlined(pt)
239
- else errorTree(tree,
240
- i """ Maximal number of successive inlines ( ${ctx.settings.xmaxInlines.value}) exceeded,
241
- | Maybe this is caused by a recursive inline method?
242
- | You can use -Xmax:inlines to change the limit. """ )
239
+ else errorTree(
240
+ tree,
241
+ i """ |Maximal number of successive inlines ( ${ctx.settings.xmaxInlines.value}) exceeded,
242
+ |Maybe this is caused by a recursive inline method?
243
+ |You can use -Xmax:inlines to change the limit. """
244
+ )
243
245
244
246
/** Replace `Inlined` node by a block that contains its bindings and expansion */
245
247
def dropInlined (inlined : tpd.Inlined )(implicit ctx : Context ): Tree = {
You can’t perform that action at this time.
0 commit comments