File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -2620,11 +2620,11 @@ object Parsers {
26202620 val start = in.skipToken()
26212621 Ident (tpnme.WILDCARD ).withSpan(Span (start, in.lastOffset, start))
26222622 case _ =>
2623- infixType()
2623+ rejectWildcardType( infixType() )
26242624 }
26252625 }
26262626 CaseDef (pat, EmptyTree , atSpan(accept(ARROW )) {
2627- val t = typ()
2627+ val t = rejectWildcardType( typ() )
26282628 if in.token == SEMI then in.nextToken()
26292629 newLinesOptWhenFollowedBy(CASE )
26302630 t
Original file line number Diff line number Diff line change 1+ type M0 [X ] = X match {
2+ case ? => String // error: Unbound wildcard type
3+ }
4+
5+ type M1 [X ] = X match {
6+ case Any => _ // error: Unbound wildcard type
7+ }
8+
9+ type M2 [X ] = X match {
10+ case Any => ? // error: Unbound wildcard type
11+ }
Original file line number Diff line number Diff line change @@ -24,5 +24,5 @@ object ABug:
2424 N match
2525 case Zero => One
2626 case One => One
27- case ? => ! [-- [N ]] × (N )
27+ case _ => ! [-- [N ]] × (N )
2828 case ? :: ? => ! [-- [N ]] × (N )
You can’t perform that action at this time.
0 commit comments