Skip to content

Incorrect error for parameter initializer referencing preceding parameter #26731

Closed

Description

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 Wenlu Wang (@Kingwl)

Activity

  1. Kingwl commented on Aug 29, 2018

    @Kingwl
    Contributor

    sorry about the broken
    i'll take a look soon 😢

  2. 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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions