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 daf4d41 commit 6459896Copy full SHA for 6459896
compiler/src/dotty/tools/dotc/parsing/Parsers.scala
@@ -1824,7 +1824,7 @@ object Parsers {
1824
1825
def typeDependingOn(location: Location): Tree =
1826
if location.inParens then typ()
1827
- else if location.inPattern then refinedType()
+ else if location.inPattern then rejectWildcardType(refinedType())
1828
else infixType()
1829
1830
/* ----------- 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