Skip to content

Importing private extension function is suggested even after importing #22429

Open
@andrzejressel

Description

@andrzejressel

Compiler version

3.3.4
3.6.3

Minimized code

https://scastie.scala-lang.org/9ViV1YHoQVaaRBfcq066Kg

import Playground.Extensions.testExt

object Extensions {
  extension (s: String) {
    private def testExt() = {
    
    }
  }
}

"abc".testExt()

Output

value testExt is not a member of String, but could be made available as an extension method.

The following import might fix the problem:

  import Playground.Extensions.testExt

Expectation

Something about testExt having too restricted visibility. At least not suggesting import when it already exists.

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