Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enum with AnyKind-ed type param instantiated to different kinds does not compile #22003

Open
TomasMikula opened this issue Nov 21, 2024 · 0 comments

Comments

@TomasMikula
Copy link
Contributor

Compiler version

3.5.0
3.6.1

Minimized code

enum Foo[T <: AnyKind]:
  case Bar extends Foo[List]
  case Baz extends Foo[Map]

Output

Found:    (Playground.Foo.Bar : Playground.Foo[List]) |
  (Playground.Foo.Baz : Playground.Foo[Map])
Required: Playground.Foo[? >: List[?] & Map[?, ?] <: List[?] | Map[?, ?]]

https://scastie.scala-lang.org/A8kJXNH1QMSMPOQe6DmCJg

Expectation

It should compile, like this equivalent sealed family:

// compiles
sealed trait Foo[T <: AnyKind]
case object Bar extends Foo[List]
case object Baz extends Foo[Map]
@TomasMikula TomasMikula added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Nov 21, 2024
@Gedochao Gedochao added area:enums and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants