File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1822,7 +1822,7 @@ object Parsers {
1822
1822
1823
1823
def typeDependingOn (location : Location ): Tree =
1824
1824
if location.inParens then typ()
1825
- else if location.inPattern then refinedType()
1825
+ else if location.inPattern then rejectWildcardType( refinedType() )
1826
1826
else infixType()
1827
1827
1828
1828
/* ----------- EXPRESSIONS ------------------------------------------------ */
Original file line number Diff line number Diff line change @@ -9,3 +9,7 @@ type M1[X] = X match {
9
9
type M2 [X ] = X match {
10
10
case Any => ? // error: Unbound wildcard type
11
11
}
12
+
13
+ val a = " " match { case _ : _ => () } // error: Unbound wildcard type
14
+
15
+ val b = try { } catch { case _ : _ => () } // error: Unbound wildcard type
Original file line number Diff line number Diff line change @@ -24,5 +24,5 @@ object ABug:
24
24
N match
25
25
case Zero => One
26
26
case One => One
27
- case ? => ! [-- [N ]] × (N )
27
+ case _ => ! [-- [N ]] × (N )
28
28
case ? :: ? => ! [-- [N ]] × (N )
You can’t perform that action at this time.
0 commit comments