From 8919fc22b1804cc1dcdcebd0b772d88be8962176 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 1 Jun 2015 21:52:54 +0100 Subject: [PATCH] only infer single identifier new expression callees --- src/babel/traversal/path/resolution.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/babel/traversal/path/resolution.js b/src/babel/traversal/path/resolution.js index 25d0f5154a..3288b9ccad 100644 --- a/src/babel/traversal/path/resolution.js +++ b/src/babel/traversal/path/resolution.js @@ -152,8 +152,8 @@ export function _inferTypeAnnotation(force?: boolean): ?Object { } } - if (path.isNodeType("NewExpression")) { - // this wont be a valid generic type annotation id unless the callee is an Identifier + if (path.isNodeType("NewExpression") && path.get("callee").isIdentifier()) { + // only resolve identifier callee return t.genericTypeAnnotation(node.callee); }