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

Pass array as rest parameters by destructuring #2793

Closed
J-F-Liu opened this issue Apr 16, 2015 · 3 comments
Closed

Pass array as rest parameters by destructuring #2793

J-F-Liu opened this issue Apr 16, 2015 · 3 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@J-F-Liu
Copy link

J-F-Liu commented Apr 16, 2015

The following code:

class GameObjectGroup extends GameObject {
    objects: GameObject[];

    constructor(...objects: GameObject[]) {
        super();
        this.objects = objects;
    }
}
class Scene extends GameObjectGroup {
    id: number;

    constructor(...objects: GameObject[]) {
        super(...objects);
    }
}

Can't compile in TypeScript 1.4, will this be supported in 1.5 or not?

@nycdotnet
Copy link

Take a look at #1931
Did you try it in the TypeScript 1.5 alpha?

@mhegazy
Copy link
Contributor

mhegazy commented Apr 16, 2015

This is doable with the latest release 1.5. See the release notes for more details: https://github.com/Microsoft/TypeScript/releases/tag/v1.5.0-alpha

@mhegazy mhegazy added the Question An issue which isn't directly actionable in code label Apr 16, 2015
@mhegazy mhegazy closed this as completed Apr 16, 2015
@J-F-Liu
Copy link
Author

J-F-Liu commented Apr 17, 2015

Tried 1.5 alpha, it works, but this is not documented in the release note.

@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
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

3 participants