only use functions returnType if it hasn't been reassigned
This commit is contained in:
parent
56c868efee
commit
ba9b85f64b
@ -224,7 +224,10 @@ Scope.prototype.inferType = function (node) {
|
|||||||
|
|
||||||
if (t.isCallExpression(target) && t.isIdentifier(target.callee)) {
|
if (t.isCallExpression(target) && t.isIdentifier(target.callee)) {
|
||||||
var funcInfo = this.getBindingInfo(target.callee.name);
|
var funcInfo = this.getBindingInfo(target.callee.name);
|
||||||
if (funcInfo) return funcInfo.node.returnType;
|
if (funcInfo) {
|
||||||
|
var funcNode = funcInfo.node;
|
||||||
|
return !funcInfo.reassigned && t.isFunction(funcNode) && node.returnType;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t.isIdentifier(target)) {
|
if (t.isIdentifier(target)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user