-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3982 from dotty-staging/fix-#3976
Fix #3976: Fix Eq method for enums with higher-kinded parameters
- Loading branch information
Showing
4 changed files
with
107 additions
and
18 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
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
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,58 @@ | ||
object Test { | ||
enum Hoge[F[_]] { | ||
case A extends Hoge[List] | ||
case B extends Hoge[[X] => String] | ||
} | ||
import Hoge._ | ||
|
||
A == A | ||
A == (B: Hoge[_]) | ||
|
||
A == B // error: cannot be compared | ||
|
||
class C | ||
|
||
A == "" // error: cannot be compared | ||
A == new C // error: cannot be compared | ||
|
||
} | ||
|
||
object Test2 { | ||
enum Hoge[F[G[_]]] { | ||
case A extends Hoge[[F[_]] => F[Int]] | ||
case B extends Hoge[[F[_]] => F[String]] | ||
} | ||
import Hoge._ | ||
|
||
A == A | ||
A == (B: Hoge[_]) | ||
|
||
A == B | ||
|
||
class C | ||
|
||
A == "" // error: cannot be compared | ||
A == new C // error: cannot be compared | ||
|
||
} | ||
|
||
object Test3 { | ||
enum Hoge[F[G[_]]] { | ||
case A extends Hoge[[X] => List] // error: wrong kind | ||
case B extends Hoge[[X] => [Y] => String] // error: wrong kind | ||
} | ||
import Hoge._ | ||
|
||
A == A | ||
A == (B: Hoge[_]) | ||
|
||
A == B | ||
|
||
class C | ||
|
||
A == "" | ||
A == new C | ||
|
||
} | ||
|
||
|
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,10 @@ | ||
object Test { | ||
enum Hoge[F[_]] { | ||
case A extends Hoge[List] | ||
case B extends Hoge[[X] => String] | ||
} | ||
import Hoge._ | ||
|
||
A == A | ||
A == (B: Hoge[_]) | ||
} |