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 @@ -62,6 +62,12 @@ class ConsoleReporter(
62
62
s " $prefix| $whitespace${carets.show}"
63
63
}
64
64
65
+ private def outer (pos : SourcePosition , prefix : String )(implicit ctx : Context ): List [String ] =
66
+ if (pos.outer.exists) {
67
+ s " $prefix| This location is in code that was inlined at ${pos.outer}" ::
68
+ outer(pos.outer, prefix)
69
+ } else Nil
70
+
65
71
def errorMsg (pos : SourcePosition , msg : String , offset : Int )(implicit ctx : Context ) = {
66
72
val leastWhitespace = msg.lines.foldLeft(Int .MaxValue ) { (minPad, line) =>
67
73
val lineLength = stripColor(line).length
@@ -101,7 +107,7 @@ class ConsoleReporter(
101
107
val marker = columnMarker(pos, offset)
102
108
val err = errorMsg(pos, msg.msg, offset)
103
109
104
- printMessage((srcBefore ::: marker :: err :: srcAfter).mkString(" \n " ))
110
+ printMessage((srcBefore ::: marker :: err :: outer(pos, " " * (offset - 1 )) ::: srcAfter).mkString(" \n " ))
105
111
} else printMessage(msg.msg)
106
112
true
107
113
}
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