Skip to content

Commit a583a24

Browse files
committed
WIP Account for inferredness in type error
1 parent 69957bb commit a583a24

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,14 @@ object Checking {
4444
ctx.error(ex"missing type parameter(s) for $arg", arg.pos)
4545
}
4646
}
47-
for ((arg, which, bound) <- ctx.boundsViolations(args, boundss, instantiate))
48-
ctx.error(
47+
for ((arg, which, bound) <- ctx.boundsViolations(args, boundss, instantiate)) {
48+
if (arg.pos.isZeroExtent)
49+
ctx.error(
4950
DoesNotConformToBound(arg.tpe, which, bound)(err),
5051
arg.pos.focus)
52+
else
53+
ctx.error(hl"inferred type ${arg.tpe} violates $which bound $bound", arg.pos.focus)
54+
}
5155
}
5256

5357
/** Check that type arguments `args` conform to corresponding bounds in `tl`

0 commit comments

Comments
 (0)