@@ -33,7 +33,7 @@ trait MessageRendering {
3333 */
3434 def outer (pos : SourcePosition , prefix : String )(implicit ctx : Context ): List [String ] =
3535 if (pos.outer.exists)
36- i " $prefix| This location is in code that was inlined at ${ pos.outer} " ::
36+ i " $prefix| This location contains code that was inlined from $ pos" ::
3737 outer(pos.outer, prefix)
3838 else Nil
3939
@@ -114,9 +114,9 @@ trait MessageRendering {
114114 */
115115 def posStr (pos : SourcePosition , diagnosticLevel : String , message : Message )(implicit ctx : Context ): String =
116116 if (pos.exists) hl(diagnosticLevel)({
117+ val pos1 = pos.nonInlined
117118 val file =
118- if (pos.source.file.exists) s " ${pos.source.file.toString}: ${pos.line + 1 }: ${pos.column}"
119- else s " ${pos.source.file.toString}: offset ${pos.start} (missing source file) "
119+ s " ${pos1.source.file.toString}: ${pos1.line + 1 }: ${pos1.column}"
120120 val errId =
121121 if (message.errorId ne ErrorMessageID .NoExplanationID ) {
122122 val errorNumber = message.errorId.errorNumber
@@ -149,9 +149,10 @@ trait MessageRendering {
149149 val posString = posStr(pos, diagnosticLevel, msg)
150150 if (posString.nonEmpty) sb.append(posString).append(EOL )
151151 if (pos.exists && pos.source.file.exists) {
152- val (srcBefore, srcAfter, offset) = sourceLines(pos, diagnosticLevel)
153- val marker = columnMarker(pos, offset, diagnosticLevel)
154- val err = errorMsg(pos, msg.msg, offset)
152+ val pos1 = pos.nonInlined
153+ val (srcBefore, srcAfter, offset) = sourceLines(pos1, diagnosticLevel)
154+ val marker = columnMarker(pos1, offset, diagnosticLevel)
155+ val err = errorMsg(pos1, msg.msg, offset)
155156 sb.append((srcBefore ::: marker :: err :: outer(pos, " " * (offset - 1 )) ::: srcAfter).mkString(EOL ))
156157 }
157158 else sb.append(msg.msg)
0 commit comments