Skip to content

Incorrect error for parameter initializer referencing preceding parameter #26731

@ajafff

Description

@ajafff

TypeScript Version: 3.1.0-dev.20180829

Search Terms:

Code

// @target: ES2015
function test(foo: string, bar = foo) {}

Expected behavior:
No error

Actual behavior:
Error Cannot find name 'foo'. in the initializer of bar

Playground Link:

Related Issues:
#26719
caused by #26317 //cc @Kingwl

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions