Skip to content

conflicting instances with inheritance from case class #18552

Closed
@SimonGuilloud

Description

@SimonGuilloud

Compiler version

Tested with 3.2.1 and 3.3.1

Minimized code

trait A
trait B extends A

trait M[+T]

case class MA(id:Int) extends M[A]
class MB(id:Int)  extends MA(id) with M[B]

Output

illegal inheritance: class MB inherits conflicting instances of non-variant base trait M.

  Direct basetype: M[Playground.B]
  Basetype via case class MA: M[A]

Expectation

Compiles, or meaningful error message. If MA is not a case class, the code compiles. The base trait M is not non-variant.

Metadata

Metadata

Labels

SpreeSuitable for a future Spreearea:desugarDesugaring happens after parsing but before typing, see desugar.scalaitype:bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions