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
This seems like a simple oversight where the methods were defined without a [B >: A] type parameter.
[B >: A]
These don't work:
scala> None #:: Stream(Some(1)) <console>:12: error: type mismatch; found : None.type required: Some[Int] None #:: Stream(Some(1)) ^ scala> Stream(None) #::: Stream(Some(1)) <console>:12: error: type mismatch; found : scala.collection.immutable.Stream[None.type] required: scala.collection.immutable.Stream[Some[Int]] Stream(None) #::: Stream(Some(1)) ^
but surely they should given that List :: and ::: allow it:
scala> None :: List(Some(1)) res2: List[Option[Int]] = List(None, Some(1)) scala> List(None) ::: List(Some(1)) res4: List[Option[Int]] = List(None, Some(1))
And given that other Stream operations allow widening:
scala> Stream.cons(None, Stream(Some(1))) res10: Stream.Cons[Option[Int]] = Stream(None, ?) scala> Stream(None).append(Stream(Some(1))) res12: scala.collection.immutable.Stream[Option[Int]] = Stream(None, ?) scala> Stream(None) ++ Stream(Some(1)) res13: scala.collection.immutable.Stream[Option[Int]] = Stream(None, ?)
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-9886?orig=1 Reporter: @SethTisue Affected Versions: 2.11.8, 2.12.0-M5
Sorry, something went wrong.
@ruippeixotog said: scala/scala#5522
Has this ticket been fixed by scala/scala#5522?
Yes, it was fixed with scala/scala#5522:
Welcome to Scala 2.12.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_152). Type in expressions for evaluation. Or try :help. scala> None #:: Stream(Some(1)) res0: scala.collection.immutable.Stream[Option[Int]] = Stream(None, ?) scala> Stream(None) #::: Stream(Some(1)) res1: scala.collection.immutable.Stream[Option[Int]] = Stream(None, ?)
Thanks for noticing that this was still open, I'll close this now.
No branches or pull requests
This seems like a simple oversight where the methods were defined without a
[B >: A]
type parameter.These don't work:
but surely they should given that List :: and ::: allow it:
And given that other Stream operations allow widening:
The text was updated successfully, but these errors were encountered: