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
flow - allow type parameter defaults in function declarations #10084
Conversation
tanhauhau
commented
Jun 11, 2019
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 |
fyi @samwgoldman |
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/10950/ |
b627142
to
ba1b9f7
Compare
14d4e00
to
445cd2a
Compare
There was a problem hiding this 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?
(class A { | ||
foo<T = string>() {} | ||
}); | ||
declare function foo<T = string>() {} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
🤷♂
There was a problem hiding this 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