The { after a function generic type annotation is a statement (#578)

This would have previously been interpreted as an expression,
because usually after ">" there can't be a statement.

Fixes #36
This commit is contained in:
Nicolò Ribaudo
2017-06-15 16:39:39 +02:00
committed by Brian Ng
parent 50ae16de38
commit 6b4fba4deb
3 changed files with 283 additions and 0 deletions

View File

@@ -958,6 +958,7 @@ export default (superClass: Class<Parser>): Class<Parser> => class extends super
this.state.inType = true;
const type = this.flowParseUnionType();
this.state.inType = oldInType;
this.state.exprAllowed = false;
return type;
}