We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_102). Type in expressions for evaluation. Or try :help. scala> :paste // Entering paste mode (ctrl-D to finish) trait Converter { type To type From } object Converter { type Aux[-From0, +To0] = Converter { type To <: To0 type From >: From0 } } trait Outer { trait InnerLike { this: Inner => type To type From type F = Converter.Aux[From, To] } type Inner <: InnerLike def cast(inner: Inner)(f: inner.F): Inner#F = f } // Exiting paste mode, now interpreting. <console>:28: error: type mismatch; found : inner.F (which expands to) Converter{type To <: inner.To; type From >: inner.From} required: Converter{type To <: _2.To; type From >: _2.From} forSome { val _2: Outer.this.Inner } def cast(inner: Inner)(f: inner.F): Inner#F = f ^
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-10008?orig=1 Reporter: @Atry Affected Versions: 2.10.6, 2.11.8, 2.12.0
Sorry, something went wrong.
@Atry said (edited on Nov 1, 2016 2:22:39 PM UTC):
trait Converter { type To type From } object Converter { type Aux[-From0, +To0] = Converter { type To <: To0 type From >: From0 } } trait Outer { trait InnerLike { this: Inner => type To type From type F >: Converter.Aux[From, To] <: Converter.Aux[From, To] // This works } type Inner <: InnerLike def cast(inner: Inner)(f: inner.F): Inner#F = f }
A workaround is making F an abstract type.
F
No branches or pull requests
The text was updated successfully, but these errors were encountered: