File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ object Test {
2
+ class Inv [T ]
3
+ type M [t] = t match {
4
+ case Inv [u] => u
5
+ }
6
+ def foo : M [Inv [Int ] & Inv [String ]] = " " // error
7
+ // ^^
8
+ // Found: ("" : String)
9
+ // Required: Test.M[Test.Inv[Int] & Test.Inv[String]]
10
+ //
11
+ // Note: a match type could not be fully reduced:
12
+ //
13
+ // trying to reduce Test.M[Test.Inv[Int] & Test.Inv[String]]
14
+ // failed since selector Test.Inv[Int] & Test.Inv[String]
15
+ // is uninhabited (there are no values of that type).
16
+
17
+
18
+ def bar : M [Inv [String ] & Inv [Int ]] = 0 // error
19
+ // ^
20
+ // Found: (0 : Int)
21
+ // Required: Test.M[Test.Inv[String] & Test.Inv[Int]]
22
+
23
+ // Note: a match type could not be fully reduced:
24
+
25
+ // trying to reduce Test.M[Test.Inv[String] & Test.Inv[Int]]
26
+ // failed since selector Test.Inv[String] & Test.Inv[Int]
27
+ // is uninhabited (there are no values of that type).
28
+ }
You can’t perform that action at this time.
0 commit comments