forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
633812e
commit 133cb46
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
-- [E007] Type Mismatch Error: tests/neg/6571.scala:6:39 --------------------------------------------------------------- | ||
6 | def foo: M[Inv[Int] & Inv[String]] = "" // error | ||
| ^^ | ||
| Found: ("" : String) | ||
| Required: Test.M[Test.Inv[Int] & Test.Inv[String]] | ||
| | ||
| Note: a match type could not be fully reduced: | ||
| | ||
| trying to reduce Test.M[Test.Inv[Int] & Test.Inv[String]] | ||
| failed since selector Test.Inv[Int] & Test.Inv[String] | ||
| is uninhabited (there are no values of that type). | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E007] Type Mismatch Error: tests/neg/6571.scala:7:39 --------------------------------------------------------------- | ||
7 | def bar: M[Inv[String] & Inv[Int]] = 0 // error | ||
| ^ | ||
| Found: (0 : Int) | ||
| Required: Test.M[Test.Inv[String] & Test.Inv[Int]] | ||
| | ||
| Note: a match type could not be fully reduced: | ||
| | ||
| trying to reduce Test.M[Test.Inv[String] & Test.Inv[Int]] | ||
| failed since selector Test.Inv[String] & Test.Inv[Int] | ||
| is uninhabited (there are no values of that type). | ||
| | ||
| longer explanation available when compiling with `-explain` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
object Test { | ||
class Inv[T] | ||
type M[t] = t match { | ||
case Inv[u] => u | ||
} | ||
def foo: M[Inv[Int] & Inv[String]] = "" // error | ||
def bar: M[Inv[String] & Inv[Int]] = 0 // error | ||
} |