Skip to content

t.tsTypeParameter should take 3 parameters but throws #10317

@deificx

Description

@deificx

Bug Report

Current Behavior
calling t.tsTypeParameter with the name parameter yields Error: TSTypeParameter: Too many arguments passed. Received 3 but can receive no more than 2

Input Code

const generate = require("@babel/generator").default;
const t = require("@babel/types");

const ast = t.tsTypeParameter(
  t.tsTypeReference(t.identifier("bar")),
  t.tsTypeReference(t.identifier("baz")),
  "foo"
);

const { code } = generate(ast);
console.log(code);

Expected behavior/code
should output foo extends bar = baz

Babel Configuration (.babelrc, package.json, cli command)
N/A

Environment

  • Babel version(s): 7.4.4
  • Node/npm version: Node v10.12.0 / yarn 1.17.3
  • OS: Ubuntu 18.04

Possible Solution
Add name to visitor

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: typescriptoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions