Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Update AST for TypeParameterInstantiation when type keyword used #373

Closed
JamesHenry opened this issue Aug 20, 2017 · 0 comments
Closed

Update AST for TypeParameterInstantiation when type keyword used #373

JamesHenry opened this issue Aug 20, 2017 · 0 comments

Comments

@JamesHenry
Copy link
Member

@andy-ms For this source:

foo<A>();
foo<number>();

...we are currently consistently using TSTypeReference for each foo example - i.e. for both type argument A and type argument number.

I observed this as a difference between this parser and babylon, and inferred that, when the type argument is a type keyword, you just the type directly in the AST.

This seems to make a lot of sense, so I will update the AST in this project accordingly.

Example diff:

-              "type": "TSTypeReference",
-              "typeName": Object {
-                "loc": Object {
-                  "end": Object {
-                    "column": 10,
-                    "line": 2,
-                  },
-                  "start": Object {
-                    "column": 4,
-                    "line": 2,
-                  },
-                },
-                "range": Array [
-                  14,
-                  20,
-                ],
-                "type": "TSNumberKeyword",
-              },
+              "type": "TSNumberKeyword",
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant