Skip to content

Spurious "illegal trait inheritance" #12722

@oyvindberg

Description

@oyvindberg

Compiler version

3.0.0

Minimized code

The two first types are a minimization of scalajs-library, making this code independent of scalajs.
The last five form a somewhat interesting inheritance chain.

trait JsAny extends AnyRef
class JsObject extends JsAny

trait HTMLAttributes[T] extends JsObject
trait Component[P] extends JsObject
trait IPersonaSharedProps extends HTMLAttributes[PersonaCoinBase]
trait PersonaCoinBase extends Component[IPersonaCoinProps]
trait IPersonaCoinProps extends IPersonaSharedProps

Output


-- Error: tester.scala:8:32 
8 |trait IPersonaCoinProps extends IPersonaSharedProps
  |                                ^^^^^^^^^^^^^^^^^^^
  |illegal trait inheritance: superclass Object does not derive from trait IPersonaSharedProps's superclass JsObject
1 error found

Expectation

Compiles, it did in Scala 2.

Most changes to the code above removes the compile error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions