We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3f2565 commit 0c09915Copy full SHA for 0c09915
compiler/src/dotty/tools/dotc/parsing/Parsers.scala
@@ -1821,7 +1821,7 @@ object Parsers {
1821
1822
def typeDependingOn(location: Location): Tree =
1823
if location.inParens then typ()
1824
- else if location.inPattern then refinedType()
+ else if location.inPattern then rejectWildcardType(refinedType())
1825
else infixType()
1826
1827
/* ----------- EXPRESSIONS ------------------------------------------------ */
tests/neg/12261.scala
@@ -9,3 +9,7 @@ type M1[X] = X match {
9
type M2[X] = X match {
10
case Any => ? // error: Unbound wildcard type
11
}
12
+
13
+val a = "" match { case _: _ => () } // error: Unbound wildcard type
14
15
+val b = try { } catch { case _: _ => () } // error: Unbound wildcard type
0 commit comments