Skip to content

Renaming interface members and object shorthand property names #12007

@normalser

Description

@normalser

TypeScript Version: nightly (2.1.0-dev.20161102)

Code

interface Test {
    foo: string
}


function bar(): Test {
    const foo = 'foo'
    return { foo }
}

Rename foo on line 2 to foo2

Expected behavior:

interface Test {
    foo2: string
}


function bar(): Test {
    const foo = 'foo'
    return { foo2: foo }
}

Actual behavior:

interface Test {
    foo2: string
}


function bar(): Test {
    const foo = 'foo'
    return { foo2 } // <------- broken code
}

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