File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ -- [E007] Type Mismatch Error: tests/neg/6571.scala:6:39 ---------------------------------------------------------------
2+ 6 | def foo: M[Inv[Int] & Inv[String]] = "" // error
3+ | ^^
4+ | Found: ("" : String)
5+ | Required: Test.M[Test.Inv[Int] & Test.Inv[String]]
6+ |
7+ | Note: a match type could not be fully reduced:
8+ |
9+ | trying to reduce Test.M[Test.Inv[Int] & Test.Inv[String]]
10+ | failed since selector Test.Inv[Int] & Test.Inv[String]
11+ | is uninhabited (there are no values of that type).
12+ |
13+ | longer explanation available when compiling with `-explain`
14+ -- [E007] Type Mismatch Error: tests/neg/6571.scala:7:39 ---------------------------------------------------------------
15+ 7 | def bar: M[Inv[String] & Inv[Int]] = 0 // error
16+ | ^
17+ | Found: (0 : Int)
18+ | Required: Test.M[Test.Inv[String] & Test.Inv[Int]]
19+ |
20+ | Note: a match type could not be fully reduced:
21+ |
22+ | trying to reduce Test.M[Test.Inv[String] & Test.Inv[Int]]
23+ | failed since selector Test.Inv[String] & Test.Inv[Int]
24+ | is uninhabited (there are no values of that type).
25+ |
26+ | longer explanation available when compiling with `-explain`
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+ def bar : M [Inv [String ] & Inv [Int ]] = 0 // error
8+ }
You can’t perform that action at this time.
0 commit comments