Skip to content

Imports don't shadow prelude #12382

@valencik

Description

@valencik

Compiler version

3.0.0-RC3

Minimized code

scala> import fs2.Stream

scala> Stream.emit(1)
1 |Stream.emit(1)
  |^^^^^^^^^^^
  |value emit is not a member of object scala.collection.immutable.Stream - did you mean Stream.empty?

Expectation

On import, fs2.Stream should shadow/hide scala.collection.immutable.Stream

Note that this works as expected in Scala 2:

# scala 2.13.5
scala> import fs2.Stream
import fs2.Stream

scala> Stream.emit(1)
val res0: fs2.Stream[[x]fs2.Pure[x],Int] = Stream(..)

I tried to hide scala.collection.immutable.Stream explicitly, but this failed as well:

# scala 3.0.0-RC3
scala> import scala.collection.immutable.{Stream => _}

scala> import fs2.Stream

scala> Stream.emit(1)
1 |Stream.emit(1)
  |^^^^^^^^^^^
  |value emit is not a member of object scala.collection.immutable.Stream - did you mean Stream.empty?

scala> fs2.Stream.emit(1)
val res0: fs2.Stream[[x] =>> fs2.Pure[x], Int] = Stream(..)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions