Skip to content

Import * now means wildcard #210

Open
@bishabosha

Description

@bishabosha

There is probably a creative example where someone previously only wanted to import a * operation and now they import every operation, and importing everything now shadows some other definition.

class Operations {
  def *(i: Int, j: Int) = i * j
  def println(any: Any): Unit = ???
}

object Main extends App {
  val ops = new Operations()
  import ops.*
  println(*(2, 3))
}

Edit: on Scala 3 running Main will eval ??? in Operations.println, but Scala 2.13 will use Predef.println and print 6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions