Program: 19446
Project: 19446
Buggy source:
private EnvTypePair analyzePropAccessFwd(Node receiver,String pname,TypeEnv inEnv,JSType requiredType,JSType specializedType){
  QualifiedName propQname=new QualifiedName(pname);
  Node propAccessNode=receiver.getParent();
  EnvTypePair pair;
  JSType reqObjType=pickReqObjType(propAccessNode);
  JSType recvReqType, recvSpecType;
  if (NodeUtil.isPropertyTest(compiler,propAccessNode) && !specializedType.isFalseOrFalsy() || specializedType.isTrueOrTruthy()) {
    recvReqType=reqObjType;
    pair=analyzeExprFwd(receiver,inEnv,recvReqType);
    JSType subtypeWithProp=pair.type.findSubtypeWithProp(propQname);
    if (subtypeWithProp.isBottom()) {
      recvSpecType=reqObjType;
    }
 else {
      recvSpecType=subtypeWithProp;
    }
    if (specializedType.isTrueOrTruthy()) {
      recvSpecType=recvSpecType.withLoose().withProperty(propQname,specializedType);
    }
 else {
      recvSpecType=recvSpecType.withProperty(propQname,specializedType);
    }
  }
 else   if (specializedType.isFalseOrFalsy()) {
    recvReqType=recvSpecType=reqObjType;
  }
 else {
    recvReqType=reqObjType.withProperty(propQname,requiredType);
    recvSpecType=reqObjType.withProperty(propQname,specializedType);
  }
  pair=analyzeExprFwd(receiver,inEnv,recvReqType,recvSpecType);
  pair=mayWarnAboutNullableReferenceAndTighten(receiver,pair.type,recvSpecType,pair.env);
  JSType recvType=pair.type.autobox();
  if (recvType.isUnknown() || mayWarnAboutNonObject(receiver,recvType,specializedType)) {
    return new EnvTypePair(pair.env,requiredType);
  }
  FunctionType ft=recvType.getFunTypeIfSingletonObj();
  if (ft != null && pname.equals("String_Node_Str")) {
    return new EnvTypePair(pair.env,commonTypes.fromFunctionType(ft.transformByCallProperty()));
  }
  if (ft != null && pname.equals("String_Node_Str")) {
    return new EnvTypePair(pair.env,commonTypes.fromFunctionType(ft.transformByApplyProperty(commonTypes)));
  }
  if (this.convention.isSuperClassReference(pname)) {
    if (ft != null && ft.isUniqueConstructor()) {
      JSType result=ft.getSuperPrototype();
      pair.type=result != null ? result : JSType.UNDEFINED;
      return pair;
    }
  }
  if (propAccessNode.isGetProp() && mayWarnAboutDictPropAccess(receiver,recvType)) {
    return new EnvTypePair(pair.env,requiredType);
  }
  if (recvType.isTop()) {
    recvType=JSType.TOP_OBJECT;
  }
  QualifiedName getterPname=new QualifiedName(createGetterPropName(pname));
  if (recvType.hasProp(getterPname)) {
    return new EnvTypePair(pair.env,recvType.getProp(getterPname));
  }
  JSType resultType=recvType.getProp(propQname);
  if (resultType != null && resultType.isBottom()) {
    warnings.add(JSError.make(propAccessNode,BOTTOM_PROP,pname,recvType.toString()));
    return new EnvTypePair(pair.env,JSType.UNKNOWN);
  }
  if (!propAccessNode.getParent().isExprResult() && !specializedType.isTrueOrTruthy() && !specializedType.isFalseOrFalsy()&& !recvType.mayBeDict()&& !mayWarnAboutInexistentProp(propAccessNode,recvType,propQname,pair.env)&& recvType.hasProp(propQname)&& !resultType.isSubtypeOf(requiredType)&& tightenTypeAndDontWarn(receiver.isName() ? receiver.getString() : null,receiver,recvType.getDeclaredProp(propQname),resultType,requiredType)) {
    resultType=resultType.specialize(requiredType);
    LValueResultFwd lvr=analyzeLValueFwd(propAccessNode,inEnv,resultType);
    TypeEnv updatedEnv=updateLvalueTypeInEnv(lvr.env,propAccessNode,lvr.ptr,resultType);
    return new EnvTypePair(updatedEnv,resultType);
  }
  if (resultType == null) {
    resultType=JSType.UNKNOWN;
  }
  return new EnvTypePair(pair.env,resultType);
}

Fixed version (ground truth):
private EnvTypePair analyzePropAccessFwd(Node receiver,String pname,TypeEnv inEnv,JSType requiredType,JSType specializedType){
  QualifiedName propQname=new QualifiedName(pname);
  Node propAccessNode=receiver.getParent();
  EnvTypePair pair;
  JSType reqObjType=pickReqObjType(propAccessNode);
  JSType recvReqType, recvSpecType;
  if (NodeUtil.isPropertyTest(compiler,propAccessNode) && !specializedType.isFalseOrFalsy() || specializedType.isTrueOrTruthy()) {
    recvReqType=reqObjType;
    pair=analyzeExprFwd(receiver,inEnv,recvReqType);
    JSType subtypeWithProp=pair.type.findSubtypeWithProp(propQname);
    if (subtypeWithProp.isBottom()) {
      recvSpecType=reqObjType;
    }
 else {
      recvSpecType=subtypeWithProp;
    }
    if (specializedType.isTrueOrTruthy()) {
      recvSpecType=recvSpecType.withLoose().withProperty(propQname,specializedType);
    }
 else {
      recvSpecType=recvSpecType.withProperty(propQname,specializedType);
    }
  }
 else   if (specializedType.isFalseOrFalsy()) {
    recvReqType=recvSpecType=reqObjType;
  }
 else {
    recvReqType=reqObjType.withProperty(propQname,requiredType);
    recvSpecType=reqObjType.withProperty(propQname,specializedType);
  }
  pair=analyzeExprFwd(receiver,inEnv,recvReqType,recvSpecType);
  pair=mayWarnAboutNullableReferenceAndTighten(receiver,pair.type,recvSpecType,pair.env);
  JSType recvType=pair.type.autobox();
  if (recvType.isUnknown() || recvType.isTrueOrTruthy() || mayWarnAboutNonObject(receiver,recvType,specializedType)) {
    return new EnvTypePair(pair.env,requiredType);
  }
  FunctionType ft=recvType.getFunTypeIfSingletonObj();
  if (ft != null && pname.equals("String_Node_Str")) {
    return new EnvTypePair(pair.env,commonTypes.fromFunctionType(ft.transformByCallProperty()));
  }
  if (ft != null && pname.equals("String_Node_Str")) {
    return new EnvTypePair(pair.env,commonTypes.fromFunctionType(ft.transformByApplyProperty(commonTypes)));
  }
  if (this.convention.isSuperClassReference(pname)) {
    if (ft != null && ft.isUniqueConstructor()) {
      JSType result=ft.getSuperPrototype();
      pair.type=result != null ? result : JSType.UNDEFINED;
      return pair;
    }
  }
  if (propAccessNode.isGetProp() && mayWarnAboutDictPropAccess(receiver,recvType)) {
    return new EnvTypePair(pair.env,requiredType);
  }
  if (recvType.isTop()) {
    recvType=JSType.TOP_OBJECT;
  }
  QualifiedName getterPname=new QualifiedName(createGetterPropName(pname));
  if (recvType.hasProp(getterPname)) {
    return new EnvTypePair(pair.env,recvType.getProp(getterPname));
  }
  JSType resultType=recvType.getProp(propQname);
  if (resultType != null && resultType.isBottom()) {
    warnings.add(JSError.make(propAccessNode,BOTTOM_PROP,pname,recvType.toString()));
    return new EnvTypePair(pair.env,JSType.UNKNOWN);
  }
  if (!propAccessNode.getParent().isExprResult() && !specializedType.isTrueOrTruthy() && !specializedType.isFalseOrFalsy()&& !recvType.mayBeDict()&& !mayWarnAboutInexistentProp(propAccessNode,recvType,propQname,pair.env)&& recvType.hasProp(propQname)&& !resultType.isSubtypeOf(requiredType)&& tightenTypeAndDontWarn(receiver.isName() ? receiver.getString() : null,receiver,recvType.getDeclaredProp(propQname),resultType,requiredType)) {
    resultType=resultType.specialize(requiredType);
    LValueResultFwd lvr=analyzeLValueFwd(propAccessNode,inEnv,resultType);
    TypeEnv updatedEnv=updateLvalueTypeInEnv(lvr.env,propAccessNode,lvr.ptr,resultType);
    return new EnvTypePair(updatedEnv,resultType);
  }
  if (resultType == null) {
    resultType=JSType.UNKNOWN;
  }
  return new EnvTypePair(pair.env,resultType);
}