Skip to content

Extension method returning implicit function can not be found #7070

@aappddeevv

Description

@aappddeevv

minimized code

def (str: String) foo: given Unit => Int = ???

given as Unit = ()

val strFoo = "".foo

gives error:

-- [E008] Member Not Found Error: local/ExtensionGiven.scala:5:16 --------------
5 |val strFoo = "".foo
  |             ^^^^^^
  |          value foo is not a member of String - did you mean String("").+?
one error found

expectation

Compile without errors.

Related to #7056?

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