File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -3291,7 +3291,7 @@ object Parsers {
32913291 * | SimplePattern1 [TypeArgs] [ArgumentPatterns]
32923292 * | ‘given’ RefinedType
32933293 * SimplePattern1 ::= SimpleRef
3294- * | SimplePattern1 `.' id
3294+ * | [ SimplePattern1] `.' id
32953295 * PatVar ::= id
32963296 * | `_'
32973297 */
@@ -3308,6 +3308,9 @@ object Parsers {
33083308 simpleExpr(Location .InPattern )
33093309 case XMLSTART =>
33103310 xmlLiteralPattern()
3311+ case DOT =>
3312+ accept(DOT )
3313+ simplePatternRest(selector(EmptyTree ))
33113314 case GIVEN =>
33123315 atSpan(in.offset) {
33133316 val givenMod = atSpan(in.skipToken())(Mod .Given ())
Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ enum Opt[+T]:
22 case none extends Opt [Nothing ]
33 case some[T ](value : T ) extends Opt [T ]
44
5+ def map [U ](f : T => U ): Opt [U ] = this match
6+ case .none => .none
7+ case Opt .some(v) => .some(f(v)) // TODO: This should be `case .some(v) => .some(f(v))`
8+ end map
9+
510object Proxy :
611 def opt (o : Opt [Int ]): Opt [Int ] = o
712
You can’t perform that action at this time.
0 commit comments