Skip to content

Commit c455e84

Browse files
committed
Fix position of typeCheckErrors
1 parent 0858612 commit c455e84

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/typer/Inliner.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ object Inliner {
288288
}
289289

290290
val Apply(_, codeArg :: Nil) = tree
291+
val codeArg1 = stripTyped(codeArg.underlying)
291292
val underlyingCodeArg =
292-
val codeArg1 = stripTyped(codeArg.underlying)
293293
if Inliner.isInlineable(codeArg1) then stripTyped(Inliner.inlineCall(codeArg1))
294294
else codeArg1
295295

@@ -308,7 +308,7 @@ object Inliner {
308308
res ++= typerErrors.map(e => ErrorKind.Typer -> e)
309309
res.toList
310310
case t =>
311-
report.error(em"argument to ${tree.symbol} must be a statically known String but was: $codeArg", codeArg.srcPos)
311+
report.error(em"argument to compileError must be a statically known String but was: $codeArg", codeArg1.srcPos)
312312
Nil
313313
}
314314

tests/run/typeCheckErrors.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
List(Error(value check is not a member of Unit,compileError("1" * 2).check(""),22,Typer), Error(argument to compileError must be a statically known String,compileError("1" * 2).check(""),13,Typer))
1+
List(Error(value check is not a member of Unit,compileError("1" * 2).check(""),22,Typer), Error(argument to compileError must be a statically known String but was: augmentString("1").*(2),compileError("1" * 2).check(""),13,Typer))

0 commit comments

Comments
 (0)