File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1822,7 +1822,7 @@ object Parsers {
18221822
18231823 def typeDependingOn (location : Location ): Tree =
18241824 if location.inParens then typ()
1825- else if location.inPattern then refinedType()
1825+ else if location.inPattern then rejectWildcardType( refinedType() )
18261826 else infixType()
18271827
18281828/* ----------- EXPRESSIONS ------------------------------------------------ */
Original file line number Diff line number Diff line change @@ -9,3 +9,7 @@ type M1[X] = X match {
99type M2 [X ] = X match {
1010 case Any => ? // error: Unbound wildcard type
1111}
12+
13+ val a = " " match { case _ : _ => () } // error: Unbound wildcard type
14+
15+ val b = try { } catch { case _ : _ => () } // error: Unbound wildcard type
You can’t perform that action at this time.
0 commit comments