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
Kind conformance passes in trait, fails in subclass with same type argument #9337
Comments
Imported From: https://issues.scala-lang.org/browse/SI-9337?orig=1 |
@adriaanm said: Both definitions should be accepted. Workaround is to duplicate the type alias, or to factor our the type constructor used for the bound on T's X. This compiles: class Bar[U] extends Foo[U] {
type VU[This <: Validator[U, This]] = Validator[U, This]
val g: TypePreservingFn[VU] = ??? // does not compile
} |
@retronym said (edited on Jun 2, 2015 3:26:49 AM UTC): But I fear my head might explode trying to write the commit comment. Perhaps you have a better chance at that :) |
This is what I came up with: scala/scala@1f4611d |
Here is the issue: trait AliasTypeRef extends NonClassTypeRef {
require(sym.isAliasType, sym)
override def dealias = if (typeParamsMatchArgs) betaReduce.dealias else super.dealias
override def narrow = normalize.narrow
override def prefix = if (this ne normalize) normalize.prefix else pre
override def termSymbol = if (this ne normalize) normalize.termSymbol else super.termSymbol
override def typeSymbol = if (this ne normalize) normalize.typeSymbol else sym the prefix of |
The text was updated successfully, but these errors were encountered: