diff options
author | Stefan Zeiger <szeiger@novocode.com> | 2017-02-08 16:32:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-08 16:32:34 +0100 |
commit | c5c391c7d698ed17e1b23c69025ed70f99f34f77 (patch) | |
tree | da38e8a4b9ce9fbf35337aacac495b8c9a2d49a6 /src/library | |
parent | 1aa864372fc7db45f7043ef9c9075043e57269b5 (diff) | |
parent | 155d06a500f9855e16c06346e09b9ca5f0e0f910 (diff) | |
download | scala-c5c391c7d698ed17e1b23c69025ed70f99f34f77.tar.gz scala-c5c391c7d698ed17e1b23c69025ed70f99f34f77.tar.bz2 scala-c5c391c7d698ed17e1b23c69025ed70f99f34f77.zip |
Merge pull request #5522 from ruippeixotog/issue/9886
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 |