This project is read-only.

Possible bug in declarations file when using index signatures

Topics: General
Oct 8, 2012 at 8:17 PM
Edited Oct 8, 2012 at 8:18 PM

I've got the following class definition:

export class SceneNode {
    private m_nodes: { [index: string]: SceneNode; };

After compilation, the following declaration is created in the .d.ts file:

export class SceneNode {
    private m_nodes: [index: string] => SceneNode;

Where did the curly brackets go? Is this intended?

If I include a reference comment to this file from inside another project, Visual Studio complains about an  "Unexpected '[' in class definition" at that line.

Oct 10, 2012 at 4:38 PM

This looks like it was a bug in the .d.ts generation.  It appears to have been fixed in develop with

Oct 10, 2012 at 4:39 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.