Skip to content

Conversation

@sandersn
Copy link
Member

@sandersn sandersn commented Sep 7, 2017

This is a late-stage name replacement in checkObjectLiteral, so it's a special-case of Ron's upcoming dynamic names change.

Fixes #16687

@mthurlin
Copy link

With this change, will the following be supported?

function makeFooOrBar(key: "foo" | "bar"): {foo: number} | {bar: number} {
    return {[key]: 4711}; // Currently an error, as "key" is widened to string
}

@mhegazy
Copy link
Contributor

mhegazy commented Nov 13, 2017

@mthurlin that is tracked by #13948

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants