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

Add function type parameters #52

Closed
@nzakas

Description

@nzakas

For code like this:

function a<X>(b:string):X {}

The <X> is missing from the output AST. This should be represented in the typeParameters property of the FunctionDeclaration, like this:

      "typeParameters": {
        "type": "TypeParameterDeclaration",
        "loc": {
          "start": {
            "line": 1,
            "column": 10
          },
          "end": {
            "line": 1,
            "column": 13
          }
        },
        "range": [
          10,
          13
        ],
        "params": [
          {
            "type": "TypeParameter",
            "loc": {
              "start": {
                "line": 1,
                "column": 11
              },
              "end": {
                "line": 1,
                "column": 12
              }
            },
            "range": [
              11,
              12
            ],
            "name": "X",
            "bound": null,
            "variance": null,
            "default": null
          }
        ]
      }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions