Skip to content

Unable to pattern match an exported enum #15347

Closed
@noti0na1

Description

@noti0na1

Compiler version

3.1.3-RC2 and main branch

Minimized code

enum E[T]:
  case A(i: Int)

export E.*

def f(x: E[Int]) = x match
  case A(i) => i

Output

case A(i) => i
|       ^
|       Not found: A
  • If we change export to import, there is no error
  • If we remove the type parameter of E, there is no error
  • If we change case A(i: Int) to case A(i: T), the error is same; change export to import here, there is no error as well
  • If we change case A(i: Int) to case A(i: Int) extends E[Int], there is no error

Expectation

I expect the code can be compiled with both import and export.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions