You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some investigating, I found out that babel's AST design is related to flow.js.
In older versions of flow.js(<v0.176.0), it was indeed possible to write the type into the pattern.
const[a: number,b: string,c: boolean]=['a',true,1];a.toLocaleLowerCase();// a === stringb-1// b === booleanc.toFixed();// c === numberconstarr: string[]=[];const[d: number]=arr;d.toLocaleLowerCase();
Describe the bug
I don't think the
typeAnnotation
should be attached on pat.1. VarDeclarator
The typeAnnotation should always be attached on the VarDeclarator, not the pat.
Expect:
Actual:
the type_ann is in the name.
2. Param
There should be a type_ann in the Param like VarDeclarator.
3. init in the Param
Expect :
Actual:
got AssignPat
It's better to remove
typeAnnotation
from Pat and add it to other AST struct like Param, VarDeclarator.Input code
No response
Config
No response
Playground link
No response
Expected behavior
/
Actual behavior
No response
Version
N/A
Additional context
No response
The text was updated successfully, but these errors were encountered: