Skip to content

Commit ee4354e

Browse files
committed
Add and fix missing testcases with with
1 parent f5d1c3b commit ee4354e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ object Parsers {
835835
if (ctx.settings.strict.value)
836836
deprecationWarning(DeprecatedWithOperator())
837837
in.nextToken()
838-
AndTypeTree(t, withType())
838+
AndTypeTree(checkWildcard(t), checkWildcard(withType()))
839839
}
840840
else t
841841

tests/neg/i4373.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ class X1[A >: _ | X1[_]] // error
55
class X2[A >: _ & X2[_]] // error
66
class X3[A >: X3[_] | _] // error
77
class X4[A >: X4[_] & _] // error
8+
class X5[A >: _ with X5[_]] // error
9+
class X6[A >: X6[_] with _] // error
10+
11+
// From 28752b8fb9b6db06fff4c606c3a402dc12b0ee06.scala:
12+
object i7 {
13+
val i8: i0[Int] = classOf[Nothing, _ with i5]()
14+
}
815

916
class A1 extends _ // error
1017
class A2 extends _ with _ // error // error

0 commit comments

Comments
 (0)