Skip to content

Language feature flag doesn't export #15013

Open
@Adam-Vandervorst

Description

@Adam-Vandervorst

Compiler version

3.1.2

Minimized code

object Content:
  implicit lazy val answer: Int = 42

object DSL:
  export scala.language.postfixOps
  export Content.answer

  extension (n: Int)
    def test : Boolean = n == 1

object Test:
  import DSL.{*, given}

  val a = answer // works
  val b = 2 test // fails

Output

postfix operator `test` needs to be enabled
by making the implicit value scala.language.postfixOps visible.

Expectation

Compile.

Requiring the feature flag imports everywhere (some logic using these is used) is cumbersome.
Moreover, it is often desireable to encapsulate these in (optional) objects, avoiding compiler options making them avaiable to the whole project.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions