Skip to content

Commit 1fb2631

Browse files
authored
Merge pull request #9823 from SethTisue/has-not-the-same-kind
make an error message wording more idiomatic
2 parents 7dc0107 + 2ba96bf commit 1fb2631

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ object Checking {
156156
if (arg.tpe.widen.isRef(defn.NothingClass) ||
157157
!paramBounds.exists ||
158158
arg.tpe.hasSameKindAs(paramBounds.bounds.hi)) arg
159-
else errorTree(arg, em"Type argument ${arg.tpe} has not the same kind as its bound $paramBounds")
159+
else errorTree(arg, em"Type argument ${arg.tpe} does not have the same kind as its bound $paramBounds")
160160

161161
def preCheckKinds(args: List[Tree], paramBoundss: List[Type])(using Context): List[Tree] = {
162162
val args1 = args.zipWithConserve(paramBoundss)(preCheckKind)

tests/neg-custom-args/kind-projector.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
-- Error: tests/neg-custom-args/kind-projector.scala:5:23 --------------------------------------------------------------
66
5 |class Bar1 extends Foo[Either[*, *]] // error
77
| ^^^^^^^^^^^^
8-
| Type argument Either has not the same kind as its bound [_$1]
8+
| Type argument Either does not have the same kind as its bound [_$1]
99
-- Error: tests/neg-custom-args/kind-projector.scala:6:22 --------------------------------------------------------------
1010
6 |class Bar2 extends Foo[*] // error
1111
| ^
12-
| Type argument _$4 has not the same kind as its bound [_$1]
12+
| Type argument _$4 does not have the same kind as its bound [_$1]

tests/neg/kinds1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ object Test {
55

66
class B
77

8-
val x: C[C] = ??? // error: Type argument has not the same kind as its bound
8+
val x: C[C] = ??? // error: Type argument does not have the same kind as its bound
99
val y: C2[C] = ???
1010

1111
def f[T] = ???

tests/pending/neg/kinds1.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[68..69] in kinds1.scala
2-
Type argument Test.C has not the same kind as its bound
2+
Type argument Test.C does not have the same kind as its bound

0 commit comments

Comments
 (0)