We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e60814 commit 2662cdcCopy full SHA for 2662cdc
tests/pos/i7807.scala
@@ -1,3 +1,16 @@
1
object Test with
2
3
def flip: (x: 0 | 1) => x.type match { case 0 => 1 case 1 => 0 } = ???
4
+
5
+ flip(0): 1
6
+ flip(1): 0
7
8
+ flip(if ??? then 0 else 1)
9
+ val n: 0 | 1 = if ??? then 0 else 1
10
+ flip(n)
11
12
+ val m: n.type match { case 0 => 1 case 1 => 0 } = flip(n)
13
14
+ // The following do not work, see discussion in https://github.com/lampepfl/dotty/pull/7835/files/6e60814e69be5c8d60265d4ce4bc1758863c23d8#r361741296:
15
+ // flip(m)
16
+ // flip(flip(n))
0 commit comments