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
class ImplicitNotFound { def main(arguments: Array[String]) { { implicit def view[A: Manifest](a: Int): Array[A] = ??? val array: Array[Int] = 1 // OK } { implicit def view[A: Manifest](a: Int): Seq[A] = ??? val seq: Seq[Int] = view(1) // OK } { implicit def view[A: Manifest](a: Int): Seq[A] = ??? val seq: Seq[Int] = 1 // type mismatch; found : Int(1) required: Seq[Int] } } }
I think this is a bug, because:
val seq: Seq[Int] = view(1)
view
val seq: Seq[Int] = 1
Workaround:
type InvariantSeq[A] = Seq[A] implicit def view[A: Manifest](a: Int): InvariantSeq[A] = ??? val invariantSeq: InvariantSeq[Int] = 1 // OK val seq: Seq[Int] = invariantSeq // OK
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-8378?orig=1 Reporter: @Atry Affected Versions: 2.10.3
Sorry, something went wrong.
@adriaanm said: This compiles on 2.11.0-RC1, expanding to:
val seq: Seq[Int] = view[Nothing](1)(reflect.this.ManifestFactory.Nothing)
No branches or pull requests
I think this is a bug, because:
val seq: Seq[Int] = view(1)
is valid.view
is implicit.val seq: Seq[Int] = 1
should be converted toval seq: Seq[Int] = view(1)
, but it's not.Workaround:
The text was updated successfully, but these errors were encountered: