Skip to content

local variable name in function parameter shadows package name #11044

Closed
@scalavision

Description

@scalavision

Minimized code

package interrupt

sealed trait InterruptType
case class Stop() extends InterruptType

final class Interrupt {

  def stop(interrupt: String) =
    println(interrupt)
    interrupt.Stop()
}

Output

[error] -- [E008] Not Found Error: /home/yoda/Projects/tmp/scala3-example-project/src/main/scala/minimal/SmallTest.scala:10:14 
[error] 10 |    interrupt.Stop()
[error]    |    ^^^^^^^^^^^^^^
[error]    |    value Stop is not a member of String - did you mean interrupt.strip?

Expectation

should compile (it is compiling in scala 2.13)

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