Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flow - allow type parameter defaults in function declarations #10084

Conversation

tanhauhau
Copy link
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
Member Author

fyi @samwgoldman

@babel-bot
Copy link
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
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
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
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
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
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