Skip to content

Method supercall doesn't work inside let expression #1309

@HT154

Description

@HT154
open class A {
  function foo() = "a"
}

class B extends A {
  function foo() =
    let (bar = "b")
      super.foo() + bar
}

Result

–– Pkl Error ––
Cannot invoke a supermethod from here.

8 | super.foo() + bar
    ^^^^^^^^^^^
at test#B.foo.<function#1> (file://<dir>/test.pkl, line 8)

This works as expected:

class B extends A {
  function foo() =
    super.foo() + "b"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions