Skip to content

Incorrect error for parameter properties references #26719

Closed

Description

class Foo {
    constructor(public x = 12, public y = x.toFixed()) {}
}

Expected behavior:
No error.

Actual behavior:
Can't find name 'x' in the expression 'x.toFixed()'.

Caused by #26317, so the fix should be an easy modification to that new code.

Activity

  1. weswigham commented on Aug 28, 2018

    @weswigham
    Member

    Reminder that target: es2015 needs to be set, too.

  2. RyanCavanaugh commented on Aug 28, 2018

    @RyanCavanaugh
    Member
  3. Kingwl commented on Aug 29, 2018

    @Kingwl
    Contributor

    sorry about that, i will take a look soon

  4. locked as resolved and limited conversation to collaborators on Oct 21, 2025
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

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions