Skip to content

flow - allow type parameter defaults in function declarations#10084

Merged
nicolo-ribaudo merged 6 commits intobabel:masterfrom
tanhauhau:tanlh/feat/allow-type-parameter-default-for-function-declaration
Jun 15, 2019
Merged

flow - allow type parameter defaults in function declarations#10084
nicolo-ribaudo merged 6 commits intobabel:masterfrom
tanhauhau:tanlh/feat/allow-type-parameter-default-for-function-declaration

Conversation

@tanhauhau
Copy link
Copy Markdown
Member

Q                       A
Fixed Issues? Fixes #10083
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature? 👍
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

@tanhauhau
Copy link
Copy Markdown
Member Author

fyi @samwgoldman

@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Jun 11, 2019

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/10950/

@tanhauhau tanhauhau force-pushed the tanlh/feat/allow-type-parameter-default-for-function-declaration branch from b627142 to ba1b9f7 Compare June 12, 2019 03:45
@tanhauhau tanhauhau force-pushed the tanlh/feat/allow-type-parameter-default-for-function-declaration branch from 14d4e00 to 445cd2a Compare June 13, 2019 15:47
@tanhauhau tanhauhau mentioned this pull request Jun 13, 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.

The parameter doesn't seem to be used anymore:

allowDefault?: boolean = true,

Can we remove it?

@nicolo-ribaudo nicolo-ribaudo added area: flow pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Jun 13, 2019
(class A {
foo<T = string>() {}
});
declare function foo<T = string>() {}
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.

Since we're in here shuffling things, can we give these tests better names so we don't have to go through this renumbering?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i wonder how i should name it, i copied the test case from flow fixtures, should i renamed it based on their test id?

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.

Maybe:

default-invalid-declare-func
default-invalid-var-type
default-invalid-class-extends

🤷‍♂

Copy link
Copy Markdown
Member

@existentialism existentialism left a comment

Choose a reason for hiding this comment

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

Just one nit/todo (not really blocking), otherwise LGTM

@nicolo-ribaudo nicolo-ribaudo merged commit fdbbb74 into babel:master Jun 15, 2019
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: flow outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser 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.

[Flow] Function type parameters supports default arguments.

4 participants