Allow function types in type params within arrow return types (#8954)
This commit is contained in:
committed by
Brian Ng
parent
e85faec47d
commit
cd81b079ee
@@ -638,12 +638,15 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
this.state.inType = true;
|
||||
|
||||
this.expectRelational("<");
|
||||
const oldNoAnonFunctionType = this.state.noAnonFunctionType;
|
||||
this.state.noAnonFunctionType = false;
|
||||
while (!this.isRelational(">")) {
|
||||
node.params.push(this.flowParseType());
|
||||
if (!this.isRelational(">")) {
|
||||
this.expect(tt.comma);
|
||||
}
|
||||
}
|
||||
this.state.noAnonFunctionType = oldNoAnonFunctionType;
|
||||
this.expectRelational(">");
|
||||
|
||||
this.state.inType = oldInType;
|
||||
|
||||
Reference in New Issue
Block a user