Skip to content
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

Declaration file generated for destructuring elements is incorrect. #2023

Closed
sheetalkamat opened this issue Feb 12, 2015 · 2 comments
Closed
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@sheetalkamat
Copy link
Member

Destructuing is not handled correctly (either object literal or array binding pattern) in during declaration emit.

Eg.

TypeScript
var { a, b } = { a: "10", b: 10 };


Generates

``` TypeScript```
declare var { a, b }: any;

Expected:

TypeScript
declare var a: string, b: number;

@yuit
Copy link
Contributor

yuit commented Mar 17, 2015

var a1 = [1, "hello"];
var [x] = a1;
var [x, y] = a1;
var [x, y, z] = a1

Generates

declare var [x]: any;
declare var [x, y]: any;

Expected:

declare var x: string|number;
declare var x: string|number, y:string|number;

@yuit
Copy link
Contributor

yuit commented Mar 18, 2015

This #2025 has fixed the issue

@yuit yuit closed this as completed Mar 18, 2015
@yuit yuit added the Fixed A PR has been merged for this issue label Mar 18, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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