Skip to content

Add a builder definition including name for tsTypeParameter#10319

Merged
nicolo-ribaudo merged 1 commit intobabel:masterfrom
deificx:10317-tsTypeParameter-should-take-a-name
Aug 15, 2019
Merged

Add a builder definition including name for tsTypeParameter#10319
nicolo-ribaudo merged 1 commit intobabel:masterfrom
deificx:10317-tsTypeParameter-should-take-a-name

Conversation

@deificx
Copy link
Copy Markdown
Contributor

@deificx deificx commented Aug 11, 2019

Q                       A
Fixed Issues? Fixes #10317
Patch: Bug Fix? Yes
Major: Breaking Change? No
Minor: New Feature? No
Tests Added + Pass? Yes
Documentation PR Link babel/website#2080
Any Dependency Changes? No
License MIT

Adds name to the visitor field for TSTypeParameter, this is a required field but since it is not listed here the assert fails rendering the function useless, since it cannot be called with either 2 or 3 arguments.

Documentation: I found this when trying to run all the t.* builder functions, but my generation "fails" here because it doesn't look like these arguments are required, they are (which has been corrected in the current master). So I will need to re-run that generation once that fix is available.


defineType("TSTypeParameter", {
visitor: ["constraint", "default"],
visitor: ["constraint", "default", "name"],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only nodes can be visited, so we can't add name to visitor.
You can define builder: ["constraint", "default", "name"], instead.

@deificx deificx changed the title Add name to visitor definitions for tsTypeParameter Add a builder definition including name for tsTypeParameter Aug 12, 2019
Copy link
Copy Markdown
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CircleCI failure is unrelated

@nicolo-ribaudo nicolo-ribaudo added area: typescript pkg: types PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Aug 14, 2019
@nicolo-ribaudo nicolo-ribaudo merged commit eb3767d into babel:master Aug 15, 2019
@deificx deificx deleted the 10317-tsTypeParameter-should-take-a-name branch August 16, 2019 09:38
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Nov 15, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Nov 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: typescript outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: types PR: Bug Fix 🐛 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

t.tsTypeParameter should take 3 parameters but throws

3 participants