Skip to content

signature of implementation of a generic method in trait is not checked #5445

Closed
@kory33

Description

@kory33

The following code should not compile, as it allows unsound constructs:

object Test {

  trait A { def polymorphic[x]: Int }
  val a = new A { val polymorphic = Unit }

}

(compiles in both 0.10.0-RC1 and 0.11.0-bin-20181113-bf5ba46-NIGHTLY.)

The code fails as expected when trait is replaced with abstract class.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions