Skip to content

Cannot inline functional interface as parameter  #8845

Closed
@edolgy

Description

@edolgy
  trait IntToLong:
    def apply(v: Int) : Long

  inline def convert1(       f: IntToLong) = ???
  inline def convert2(inline f: IntToLong) = ???

  convert1(_ * 10)  // Compiles Fine
  convert2(_ * 10)  // Error:  Found: Int => Long, Required: IntToLong @InlineParam

Is this supposed to work at all?

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