Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kory33 opened this issue Nov 15, 2018 · 1 comment
Closed

Comments

@kory33
Copy link

kory33 commented Nov 15, 2018

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.

@odersky
Copy link
Contributor

odersky commented Dec 17, 2018

Fixed by #5622

@odersky odersky closed this as completed Dec 17, 2018
odersky added a commit to dotty-staging/dotty that referenced this issue Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants