Program: 27160
Project: 27160
Buggy source:
/** 
 * Called for the usual style of prototype-property definitions, but also for @lends and for direct assignments of object literals to prototypes.
 */
private void mayAddPropToPrototype(RawNominalType rawType,String pname,Node defSite,Node initializer){
  NTIScope methodScope=null;
  DeclaredFunctionType methodType=null;
  JSType propDeclType=null;
  JSDocInfo jsdoc=NodeUtil.getBestJSDocInfo(defSite);
  if (initializer != null && initializer.isFunction()) {
    methodScope=visitFunctionLate(initializer,rawType);
    methodType=methodScope.getDeclaredFunctionType();
    if (defSite.isGetterDef()) {
      pname=getCommonTypes().createGetterPropName(pname);
    }
 else     if (defSite.isSetterDef()) {
      pname=getCommonTypes().createSetterPropName(pname);
    }
  }
 else   if (jsdoc != null && jsdoc.containsFunctionDeclaration() && !defSite.isStringKey()) {
    methodType=computeFnDeclaredType(jsdoc,pname,defSite,rawType,currentScope);
  }
  if (jsdoc != null && jsdoc.hasType()) {
    propDeclType=getTypeParser().getDeclaredTypeOfNode(jsdoc,rawType,currentScope);
  }
 else   if (methodType != null) {
    propDeclType=getCommonTypes().fromFunctionType(methodType.toFunctionType());
  }
  if (defSite.isGetterDef()) {
    FunctionType ft=propDeclType.getFunTypeIfSingletonObj();
    if (ft != null) {
      propDeclType=ft.getReturnType();
    }
  }
  PropertyDef def=new PropertyDef(defSite,methodType,methodScope);
  propertyDefs.put(rawType,pname,def);
  if (methodType != null && methodType.isAbstract() && !rawType.isAbstractClass()) {
    if (rawType.isClass()) {
      warnings.add(JSError.make(defSite,ABSTRACT_METHOD_IN_CONCRETE_CLASS,rawType.getName()));
    }
 else     if (rawType.isInterface()) {
      warnings.add(JSError.make(defSite,ABSTRACT_METHOD_IN_INTERFACE));
    }
  }
  boolean isConst=isConst(defSite);
  if (propDeclType != null || isConst) {
    if (mayWarnAboutExistingProp(rawType,pname,defSite,propDeclType)) {
      return;
    }
    if (propDeclType == null) {
      propDeclType=mayInferFromRhsIfConst(defSite);
    }
    rawType.addProtoProperty(pname,defSite,propDeclType,isConst);
    if (defSite.isGetProp()) {
      defSite.putBooleanProp(Node.ANALYZED_DURING_GTI,true);
      if (isConst) {
        defSite.putBooleanProp(Node.CONSTANT_PROPERTY_DEF,true);
      }
    }
  }
 else {
    JSType inferredType=null;
    if (initializer != null) {
      inferredType=simpleInferExpr(initializer,this.currentScope);
    }
    if (inferredType == null) {
      inferredType=getCommonTypes().UNKNOWN;
    }
    rawType.addUndeclaredProtoProperty(pname,defSite,inferredType);
  }
}

Fixed version (ground truth):
/** 
 * Called for the usual style of prototype-property definitions, but also for @lends and for direct assignments of object literals to prototypes.
 */
private void mayAddPropToPrototype(RawNominalType rawType,String pname,Node defSite,Node initializer){
  NTIScope methodScope=null;
  DeclaredFunctionType methodType=null;
  JSType propDeclType=null;
  JSDocInfo jsdoc=NodeUtil.getBestJSDocInfo(defSite);
  if (initializer != null && initializer.isFunction()) {
    methodScope=visitFunctionLate(initializer,rawType);
    methodType=methodScope.getDeclaredFunctionType();
    if (defSite.isGetterDef()) {
      pname=getCommonTypes().createGetterPropName(pname);
    }
 else     if (defSite.isSetterDef()) {
      pname=getCommonTypes().createSetterPropName(pname);
    }
  }
 else   if (jsdoc != null && jsdoc.containsFunctionDeclaration() && !defSite.isStringKey()) {
    methodType=computeFnDeclaredType(jsdoc,pname,defSite,rawType,currentScope);
  }
  if (jsdoc != null && jsdoc.hasType()) {
    propDeclType=getTypeParser().getDeclaredTypeOfNode(jsdoc,rawType,currentScope);
    if ((defSite.isGetterDef() || defSite.isSetterDef()) && propDeclType != null && !propDeclType.isFunctionType()) {
      propDeclType=null;
    }
  }
 else   if (methodType != null) {
    propDeclType=getCommonTypes().fromFunctionType(methodType.toFunctionType());
  }
  if (defSite.isGetterDef() && propDeclType != null) {
    FunctionType ft=propDeclType.getFunTypeIfSingletonObj();
    if (ft != null) {
      propDeclType=ft.getReturnType();
    }
  }
  PropertyDef def=new PropertyDef(defSite,methodType,methodScope);
  propertyDefs.put(rawType,pname,def);
  if (methodType != null && methodType.isAbstract() && !rawType.isAbstractClass()) {
    if (rawType.isClass()) {
      warnings.add(JSError.make(defSite,ABSTRACT_METHOD_IN_CONCRETE_CLASS,rawType.getName()));
    }
 else     if (rawType.isInterface()) {
      warnings.add(JSError.make(defSite,ABSTRACT_METHOD_IN_INTERFACE));
    }
  }
  boolean isConst=isConst(defSite);
  if (propDeclType != null || isConst) {
    if (mayWarnAboutExistingProp(rawType,pname,defSite,propDeclType)) {
      return;
    }
    if (propDeclType == null) {
      propDeclType=mayInferFromRhsIfConst(defSite);
    }
    rawType.addProtoProperty(pname,defSite,propDeclType,isConst);
    if (defSite.isGetProp()) {
      defSite.putBooleanProp(Node.ANALYZED_DURING_GTI,true);
      if (isConst) {
        defSite.putBooleanProp(Node.CONSTANT_PROPERTY_DEF,true);
      }
    }
  }
 else {
    JSType inferredType=null;
    if (initializer != null) {
      inferredType=simpleInferExpr(initializer,this.currentScope);
    }
    if (inferredType == null) {
      inferredType=getCommonTypes().UNKNOWN;
    }
    rawType.addUndeclaredProtoProperty(pname,defSite,inferredType);
  }
}