Skip to content

Missing kind checks when overriding a type #2770

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
smarter opened this issue Jun 15, 2017 · 1 comment
Closed

Missing kind checks when overriding a type #2770

smarter opened this issue Jun 15, 2017 · 1 comment

Comments

@smarter
Copy link
Member

smarter commented Jun 15, 2017

trait A { type L }
trait B extends A { type L[X] }

In scalac this fails with:

 error: The kind of type L does not conform to the expected kind of type L in trait A.
B.this.L's type parameters do not match type L's expected parameters:
type L (in trait B) has one type parameter, but type L (in trait A) has none
trait B extends A { type L[X] }
                         ^

but it succeeds in dotty, which probably leads to interesting issues.

@Blaisorblade
Copy link
Contributor

See also #2771, though there you get an ill-kinded member from intersections.

odersky referenced this issue Jul 18, 2017
odersky added a commit that referenced this issue Jul 19, 2017
Fix #2770: Tighten type compatibility checks for overrides
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

2 participants