flow-runtime
flow-runtime copied to clipboard
babel-plugin-flow-runtime references undefined type parameter names with assertions disabled
This is a:
- [x] Bug Report
- [ ] Feature Request
- [ ] Question
- [ ] Other
Which concerns:
- [ ] flow-runtime
- [x] babel-plugin-flow-runtime
- [ ] flow-runtime-validators
- [ ] flow-runtime-mobx
- [ ] flow-config-parser
- [ ] The documentation website
Code
// @flow
function foo<X>() {
let bar: X
}
.babelrc
{
"presets": ["es2015"],
"plugins": [
"transform-decorators-legacy",
["flow-runtime", {"assert": false}]
]
}
What is the current behaviour?
X is undefined in the output code below at let _barType = X:
import t from "flow-runtime";
function foo() {
let _barType = X,
bar;
}
t.annotate(foo, t.function(_fn => {
const X = _fn.typeParameter("X");
return [];
}));
What is the expected behaviour?
Either babel-plugin-flow-runtime doesn't create _barType, or it inserts const X = t.typeParameter("X") above let _barType it despite the "assert": false in the plugin options.
Which package versions are you using?
├── [email protected]
├── [email protected]
├── [email protected]
IssueHunt Summary
Backers (Total: $40.00)
issuehunt ($40.00)
Become a backer now!
Or submit a pull request to get the deposits!
Tips
- Checkout the Issuehunt explorer to discover more funded issues.
- Need some help from other developers? Add your repositories on IssueHunt to raise funds.
IssueHunt has been backed by the following sponsors. Become a sponsor
@issuehunt has funded $40.00 to this issue.
- Submit pull request via IssueHunt to receive this reward.
- Want to contribute? Chip in to this issue via IssueHunt.
- Checkout the IssueHunt Issue Explorer to see more funded issues.
- Need help from developers? Add your repository on IssueHunt to raise funds.