diff options
author | Rui Gonçalves <ruippeixotog@gmail.com> | 2016-11-12 21:07:08 +0000 |
---|---|---|
committer | Rui Gonçalves <ruippeixotog@gmail.com> | 2017-02-02 22:14:05 +0000 |
commit | 155d06a500f9855e16c06346e09b9ca5f0e0f910 (patch) | |
tree | 9f98ffa382b39f5f79fa61409c9044470887c4d7 /src/library | |
parent | fff17320448c9691851aa16897e2fa2d75e0f11a (diff) | |
download | scala-155d06a500f9855e16c06346e09b9ca5f0e0f910.tar.gz scala-155d06a500f9855e16c06346e09b9ca5f0e0f910.tar.bz2 scala-155d06a500f9855e16c06346e09b9ca5f0e0f910.zip |
SI-9507 Make Stream #:: and #::: allow type widening
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/collection/immutable/Stream.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/library/scala/collection/immutable/Stream.scala b/src/library/scala/collection/immutable/Stream.scala index 3d4e32971c..8f26de153a 100644 --- a/src/library/scala/collection/immutable/Stream.scala +++ b/src/library/scala/collection/immutable/Stream.scala @@ -1119,11 +1119,11 @@ object Stream extends SeqFactory[Stream] { /** Construct a stream consisting of a given first element followed by elements * from a lazily evaluated Stream. */ - def #::(hd: A): Stream[A] = cons(hd, tl) + def #::[B >: A](hd: B): Stream[B] = cons(hd, tl) /** Construct a stream consisting of the concatenation of the given stream and * a lazily evaluated Stream. */ - def #:::(prefix: Stream[A]): Stream[A] = prefix append tl + def #:::[B >: A](prefix: Stream[B]): Stream[B] = prefix append tl } /** A wrapper method that adds `#::` for cons and `#:::` for concat as operations |