Skip to content
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

REPL corruption after ambiguous implicit error #7319

Closed
scabug opened this issue Apr 1, 2013 · 6 comments
Closed

REPL corruption after ambiguous implicit error #7319

scabug opened this issue Apr 1, 2013 · 6 comments

Comments

@scabug
Copy link

scabug commented Apr 1, 2013

Welcome to Scala version 2.11.0-20130330-204812-2a6e83a85e (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_37).
Type in expressions to have them evaluated.
Type :help for more information.

scala> def convert[F[X <: F[X]]](builder: F[_ <: F[_]]) = 0
warning: there were 1 feature warning(s); re-run with -feature for details
convert: [F[X <: F[X]]](builder: F[_ <: F[_]])Int

scala> convert(Some(9))
<console>:9: error: no type parameters for method convert: (builder: F[_ <: F[_]])Int exist so that it can be applied to arguments (Some[Int])
 --- because ---
argument expression's type is not compatible with formal parameter type;
 found   : Some[Int]
 required: ?F forSome { type _$1 <: ?F forSome { type _$2 } }
              convert(Some(9))
              ^
<console>:9: error: type mismatch;
 found   : Some[Int]
 required: F[_ <: F[_]]
              convert(Some(9))
                          ^
error: type mismatch;
 found   : Some[Int]
 required: ?F forSome { type _$1 <: ?F forSome { type _$2 } }
Note that implicit conversions are not applicable because they are ambiguous:
 both method ArrowAssoc in object Predef of type [A](__leftOfArrow: A)ArrowAssoc[A]
 and method Ensuring in object Predef of type [A](__resultOfEnsuring: A)Ensuring[A]
 are possible conversion functions from Some[Int] to ?F forSome { type _$1 <: ?F forSome { type _$2 } }
error: type mismatch;
 found   : Some[Int]
 required: ?F forSome { type _$1 <: ?F forSome { type _$2 } }
Note that implicit conversions are not applicable because they are ambiguous:
 both method ArrowAssoc in object Predef of type [A](__leftOfArrow: A)ArrowAssoc[A]
 and method Ensuring in object Predef of type [A](__resultOfEnsuring: A)Ensuring[A]
 are possible conversion functions from Some[Int] to ?F forSome { type _$1 <: ?F forSome { type _$2 } }
error: type mismatch;
 found   : Some[Int]
 required: ?F forSome { type _$1 <: ?F forSome { type _$2 } }
Note that implicit conversions are not applicable because they are ambiguous:
 both method ArrowAssoc in object Predef of type [A](__leftOfArrow: A)ArrowAssoc[A]
 and method Ensuring in object Predef of type [A](__resultOfEnsuring: A)Ensuring[A]
 are possible conversion functions from Some[Int] to ?F forSome { type _$1 <: ?F forSome { type _$2 } }

scala> 0
error: type mismatch;
 found   : Some[Int]
 required: ?F forSome { type _$1 <: ?F forSome { type _$2 } }
Note that implicit conversions are not applicable because they are ambiguous:
 both method ArrowAssoc in object Predef of type [A](__leftOfArrow: A)ArrowAssoc[A]
 and method Ensuring in object Predef of type [A](__resultOfEnsuring: A)Ensuring[A]
 are possible conversion functions from Some[Int] to ?F forSome { type _$1 <: ?F forSome { type _$2 } }
error: type mismatch;
 found   : Some[Int]
 required: ?F forSome { type _$1 <: ?F forSome { type _$2 } }
Note that implicit conversions are not applicable because they are ambiguous:
 both method ArrowAssoc in object Predef of type [A](__leftOfArrow: A)ArrowAssoc[A]
 and method Ensuring in object Predef of type [A](__resultOfEnsuring: A)Ensuring[A]
 are possible conversion functions from Some[Int] to ?F forSome { type _$1 <: ?F forSome { type _$2 } }
error: type mismatch;
 found   : Some[Int]
 required: ?F forSome { type _$1 <: ?F forSome { type _$2 } }
Note that implicit conversions are not applicable because they are ambiguous:
 both method ArrowAssoc in object Predef of type [A](__leftOfArrow: A)ArrowAssoc[A]
 and method Ensuring in object Predef of type [A](__resultOfEnsuring: A)Ensuring[A]
 are possible conversion functions from Some[Int] to ?F forSome { type _$1 <: ?F forSome { type _$2 } }

scala>
@scabug
Copy link
Author

scabug commented Apr 1, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7319?orig=1
Reporter: @retronym
Affected Versions: 2.10.0

@scabug
Copy link
Author

scabug commented Apr 1, 2013

@retronym said:
I expect the underlying problem is outside of the REPL, but shooting the messenger in the meantime.

@scabug
Copy link
Author

scabug commented Apr 1, 2013

@scabug
Copy link
Author

scabug commented Apr 8, 2013

@retronym said:
scala/scala#2370

@scabug scabug closed this as completed Apr 19, 2013
@scabug
Copy link
Author

scabug commented Jun 27, 2013

@SethTisue said:
see also #7345

@scabug
Copy link
Author

scabug commented Jun 27, 2013

@SethTisue said:
fwiw, a simpler way to reproduce it in 2.10.1:

scala> Stream(0).toArray
(succeeds)
scala> Array(0) ++ Stream(0).toArray
(fails)
scala> Stream(0).toArray
(fails even though it succeed before)

this came up on IRC a while back and I was tardy about reporting it. pleased to see it's fixed already :-)

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