Skip to content

LambdaLift lifts lambdas to private methods, breaking references to them. #481

Closed
@DarkDimius

Description

@DarkDimius

This is result of interaction between #342 and #480:

object O {
  val x: Function1[String, String] = a => a
}

after LambdaLift becomes

final module class O$ extends Object { this: <notype> =>
    def <init>(): O$ = {
      super()
      O.x$$local = {
        closure($anonfun$$init$$1)
      }
      ()
    }
    private val x$$local: Function1
    <accessor> def x(): Function1 = O.x$$local
    private def $anonfun$$init$$1(a: String): String = a
  }

The type of $anonfun$$init$$1 in closure is NoPrefix($anonfun$$init$$1), ie doesn't include that this private function should be called on this.
this caused #470.

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