File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ matchtype.scala
25256322.scala
2626i7087.scala
2727i7868.scala
28+ i7872.scala
2829
2930# Opaque type
3031i5720.scala
@@ -37,4 +38,4 @@ i7580.scala
3738nullable.scala
3839
3940# parameter untupling with overloaded functions (see comment in Applications.normArg)
40- i7757.scala
41+ i7757.scala
Original file line number Diff line number Diff line change 1+ object Test {
2+ def flip : (x : 0 | 1 ) => x.type match { case 0 => 1 case 1 => 0 } = ???
3+ flip(0 ): 1
4+ flip(1 ): 0
5+ flip(if ??? then 0 else 1 )
6+ val n : 0 | 1 = if ??? then 0 else 1
7+ flip(n)
8+ val m : n.type match { case 0 => 1 case 1 => 0 } = flip(n)
9+ }
10+
11+ object Test2 {
12+ type Flip [N <: 0 | 1 ] <: 0 | 1 = N match { case 0 => 1 case 1 => 0 }
13+ def flip : (x : 0 | 1 ) => Flip [x.type ] = ???
14+ flip(0 ): 1
15+ flip(1 ): 0
16+ }
17+
18+ object Test3 {
19+ type Flip [N <: 0 | 1 ] <: 0 | 1 = N match { case 0 => 1 case 1 => 0 }
20+ def flip (x : 0 | 1 ): Flip [x.type ] = ???
21+ flip(0 ): 1
22+ flip(1 ): 0
23+ }
You can’t perform that action at this time.
0 commit comments