diff --git a/src/babel/traversal/path/resolution.js b/src/babel/traversal/path/resolution.js index 70f8dfd4dc..c95c6a6887 100644 --- a/src/babel/traversal/path/resolution.js +++ b/src/babel/traversal/path/resolution.js @@ -272,7 +272,17 @@ export function _inferTypeAnnotation(force?: boolean): ?Object { if (callPath) { var callee = callPath.resolve(); // todo: read typescript/flow interfaces - if (callee.isNodeType("Function")) return callee.node.returnType; + if (callee.isNodeType("Function")) { + if (callee.is("async")) { + if (callee.is("generator")) { + // todo + } else { + return t.genericTypeAnnotation(t.identifier("Promise")); + } + } else { + return callee.node.returnType; + } + } } }