diff --git a/src/plugins/flow.js b/src/plugins/flow.js index 7c85da6255..9e6caca3db 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -505,6 +505,8 @@ pp.flowParsePrimaryType = function () { node.returnType = this.flowParseType(); return this.finishNode(node, "FunctionTypeAnnotation"); + } else { + this.unexpected(); } case tt.parenL: diff --git a/test/fixtures/flow/type-annotations/106/actual.js b/test/fixtures/flow/type-annotations/106/actual.js new file mode 100644 index 0000000000..0a8290512d --- /dev/null +++ b/test/fixtures/flow/type-annotations/106/actual.js @@ -0,0 +1 @@ +var f: >x:int) => string; diff --git a/test/fixtures/flow/type-annotations/106/options.json b/test/fixtures/flow/type-annotations/106/options.json new file mode 100644 index 0000000000..c958665c03 --- /dev/null +++ b/test/fixtures/flow/type-annotations/106/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:7)" +}