Skip to content

Method supercall doesn't work inside let expression #1309

Closed

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"
}

Activity

  1. added
    bug
    on Nov 6, 2025
  2. added a commit that references this issue on Dec 22, 2025
    5a5adf3
  3. added a commit that references this issue on Jan 10, 2026
    9d385f2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions