Skip to content

Issue with bounded recursive match types #18546

Closed as not planned
Closed as not planned
@SimonGuilloud

Description

@SimonGuilloud

Compiler version

3.3.1

Minimized example

trait A[N]

type B[N] <: A[N] = N match {
  case 0 => A[0]
  case _ => A[N]
}

Output

Found:    A[(0 : Int)]
Required: A[N]

Expectation

It seems like this should compile. I'm not sure if this is a bug or intended behaviour, but I found no reference to this situation. A real life scenario would have for example a trait A0 extending A[0].

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions