File tree Expand file tree Collapse file tree 4 files changed +27
-1
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 4 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -1988,7 +1988,7 @@ object Parsers {
19881988 if isSimpleLiteral then
19891989 SingletonTypeTree (simpleLiteral())
19901990 else if in.token == USCORE then
1991- if ctx.settings.XkindProjector .value == " underscores" then
1991+ if ctx.settings.XkindProjector .value == " underscores" && ! inMatchPattern then
19921992 val start = in.skipToken()
19931993 Ident (tpnme.USCOREkw ).withSpan(Span (start, in.lastOffset, start))
19941994 else
Original file line number Diff line number Diff line change 1+ //> using options -Xkind-projector:underscores
2+
3+ import Tuple .*
4+
5+ type LiftP [F [_], T ] <: Tuple =
6+ T match {
7+ case _ *: _ => F [Head [T ]] *: LiftP [F , Tail [T ]]
8+ case _ => EmptyTuple
9+ }
Original file line number Diff line number Diff line change 1+ //> using options -Xkind-projector:underscores
2+
3+ import scala .compiletime .ops .int .S
4+
5+ type IndexOf [T <: Tuple , E ] <: Int = T match
6+ case E *: _ => 0
7+ case _ *: es => 1 // S[IndexOf[es, E]]
Original file line number Diff line number Diff line change 1+ //> using options -Xkind-projector:underscores
2+
3+ import scala .quoted .Type
4+ import scala .quoted .Quotes
5+
6+ def x [A ](t : Type [A ])(using Quotes ): Boolean = t match
7+ case ' [_ *: _] =>
8+ true
9+ case _ =>
10+ false
You can’t perform that action at this time.
0 commit comments