Skip to content

Incorrect error for parameter properties references #26719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sandersn opened this issue Aug 28, 2018 · 3 comments
Closed

Incorrect error for parameter properties references #26719

sandersn opened this issue Aug 28, 2018 · 3 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@sandersn
Copy link
Member

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.

@weswigham
Copy link
Member

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

@RyanCavanaugh
Copy link
Member

Paging @Kingwl 😉

@Kingwl
Copy link
Contributor

Kingwl commented Aug 29, 2018

sorry about that, i will take a look soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

4 participants