…lines 1–570 unchanged (570 lines)
571 Node errorRoot = rValue == null ? lvalueNode : rValue;
572 boolean isFnLiteral =
573 rValue != null && rValue.getType() == Token.FUNCTION;
574 Node fnRoot = isFnLiteral ? rValue : null;
575 Node parametersNode = isFnLiteral ?
576 rValue.getFirstChild().getNext() : null;
577 Node fnBlock = isFnLiteral ? parametersNode.getNext() : null;
578
579 if (functionType == null && info != null && info.hasType()) {
580 JSType type = info.getType().evaluate(scope, typeRegistry);
581
582 // Known to be not null since we have the FUNCTION token there.
583 type = type.restrictByNotNullOrUndefined();
…lines 584–611 unchanged (28 lines)
612 functionType =
613 new FunctionTypeBuilder(
614 name, compiler, errorRoot, sourceName, scope)
615 .setSourceNode(fnRoot)
616 .inferFromOverriddenFunction(propType, parametersNode)
617 .inferThisType(info, owner)
618 .inferReturnStatements(fnBlock)
619 .buildAndRegister();
620 }
621 }
622 }
623 }
624 } // end if (functionType == null)
…lines 625–629 unchanged (5 lines)
630 .setSourceNode(fnRoot)
631 .inferTemplateTypeName(info)
632 .inferReturnType(info)
633 .inferInheritance(info)
634 .inferThisType(info, owner)
635 .inferParameterTypes(parametersNode, info)
636 .inferReturnStatements(fnBlock)
637 .buildAndRegister();
638 }
639
640 // assigning the function type to the function node
641 if (rValue != null) {
642 setDeferredType(rValue, functionType);
…lines 643–1433 unchanged (791 lines)