Program: 27265
Project: 27265
Buggy source:
private EnvTypePair analyzeObjLitFwd(Node objLit,TypeEnv inEnv,JSType requiredType,JSType specializedType){
  if (NodeUtil.isEnumDecl(objLit.getParent())) {
    return analyzeEnumObjLitFwd(objLit,inEnv,requiredType);
  }
  JSDocInfo jsdoc=objLit.getJSDocInfo();
  boolean isStruct=jsdoc != null && jsdoc.makesStructs();
  boolean isDict=jsdoc != null && jsdoc.makesDicts();
  TypeEnv env=inEnv;
  JSType result=pickReqObjType(objLit);
  for (  Node prop : objLit.children()) {
    if (isStruct && prop.isQuotedString()) {
      warnings.add(JSError.make(prop,ILLEGAL_OBJLIT_KEY,"String_Node_Str"));
    }
 else     if (isDict && !prop.isQuotedString()) {
      warnings.add(JSError.make(prop,ILLEGAL_OBJLIT_KEY,"String_Node_Str"));
    }
    String pname=NodeUtil.getObjectLitKeyName(prop);
    if (prop.isGetterDef() || prop.isSetterDef()) {
      EnvTypePair pair=analyzeExprFwd(prop.getFirstChild(),env);
      FunctionType funType=pair.type.getFunType();
      Preconditions.checkNotNull(funType);
      String specialPropName;
      JSType propType;
      if (prop.isGetterDef()) {
        specialPropName=JSType.createGetterPropName(pname);
        propType=funType.getReturnType();
      }
 else {
        specialPropName=JSType.createSetterPropName(pname);
        propType=pair.type;
      }
      result=result.withProperty(new QualifiedName(specialPropName),propType);
      env=pair.env;
    }
 else {
      QualifiedName qname=new QualifiedName(pname);
      JSType jsdocType=symbolTable.getPropDeclaredType(prop);
      JSType reqPtype, specPtype;
      if (jsdocType != null) {
        reqPtype=specPtype=jsdocType;
      }
 else       if (requiredType.mayHaveProp(qname)) {
        reqPtype=specPtype=requiredType.getProp(qname);
        if (specializedType.mayHaveProp(qname)) {
          specPtype=specializedType.getProp(qname);
        }
      }
 else {
        reqPtype=specPtype=UNKNOWN;
      }
      EnvTypePair pair=analyzeExprFwd(prop.getFirstChild(),env,reqPtype,specPtype);
      if (jsdocType != null) {
        result=result.withDeclaredProperty(qname,jsdocType,false);
        if (!pair.type.isSubtypeOf(jsdocType)) {
          warnings.add(JSError.make(prop,INVALID_OBJLIT_PROPERTY_TYPE,errorMsgWithTypeDiff(jsdocType,pair.type)));
          pair.type=jsdocType;
        }
      }
      result=result.withProperty(qname,pair.type);
      env=pair.env;
    }
  }
  result=mayAdjustObjLitType(objLit,jsdoc,inEnv,result);
  return new EnvTypePair(env,result);
}

Fixed version (ground truth):
private EnvTypePair analyzeObjLitFwd(Node objLit,TypeEnv inEnv,JSType requiredType,JSType specializedType){
  if (NodeUtil.isEnumDecl(objLit.getParent())) {
    return analyzeEnumObjLitFwd(objLit,inEnv,requiredType);
  }
  JSDocInfo jsdoc=objLit.getJSDocInfo();
  boolean isStruct=jsdoc != null && jsdoc.makesStructs();
  boolean isDict=jsdoc != null && jsdoc.makesDicts();
  TypeEnv env=inEnv;
  JSType result=pickReqObjType(objLit);
  for (  Node prop : objLit.children()) {
    if (isStruct && prop.isQuotedString()) {
      warnings.add(JSError.make(prop,ILLEGAL_OBJLIT_KEY,"String_Node_Str"));
    }
 else     if (isDict && !prop.isQuotedString()) {
      warnings.add(JSError.make(prop,ILLEGAL_OBJLIT_KEY,"String_Node_Str"));
    }
    String pname=NodeUtil.getObjectLitKeyName(prop);
    if (prop.isGetterDef() || prop.isSetterDef()) {
      EnvTypePair pair=analyzeExprFwd(prop.getFirstChild(),env);
      FunctionType funType=pair.type.getFunType();
      Preconditions.checkNotNull(funType);
      String specialPropName;
      JSType propType;
      if (prop.isGetterDef()) {
        specialPropName=JSType.createGetterPropName(pname);
        propType=funType.getReturnType();
      }
 else {
        specialPropName=JSType.createSetterPropName(pname);
        propType=pair.type;
      }
      result=result.withProperty(new QualifiedName(specialPropName),propType);
      env=pair.env;
    }
 else {
      QualifiedName qname=new QualifiedName(pname);
      JSType jsdocType=symbolTable.getPropDeclaredType(prop);
      JSType reqPtype;
      JSType specPtype;
      if (jsdocType != null) {
        reqPtype=specPtype=jsdocType;
      }
 else       if (requiredType.mayHaveProp(qname)) {
        reqPtype=specPtype=requiredType.getProp(qname);
        if (specializedType.mayHaveProp(qname)) {
          specPtype=specializedType.getProp(qname);
        }
      }
 else {
        reqPtype=specPtype=UNKNOWN;
      }
      EnvTypePair pair=analyzeExprFwd(prop.getFirstChild(),env,reqPtype,specPtype);
      if (jsdocType != null) {
        result=result.withDeclaredProperty(qname,jsdocType,false);
        if (!pair.type.isSubtypeOf(jsdocType)) {
          warnings.add(JSError.make(prop,INVALID_OBJLIT_PROPERTY_TYPE,errorMsgWithTypeDiff(jsdocType,pair.type)));
          pair.type=jsdocType;
        }
      }
      result=result.withProperty(qname,pair.type);
      env=pair.env;
    }
  }
  result=mayAdjustObjLitType(objLit,jsdoc,inEnv,result);
  return new EnvTypePair(env,result);
}