Program: 27208
Project: 27208
Buggy source:
private LValueResultFwd analyzeLValueFwd(Node expr,TypeEnv inEnv,JSType requiredType,boolean insideQualifiedName){
  LValueResultFwd lvalResult=null;
switch (expr.getToken()) {
case THIS:
{
      mayWarnAboutGlobalThis(expr);
      if (this.currentScope.hasThis()) {
        lvalResult=new LValueResultFwd(inEnv,envGetType(inEnv,THIS_ID),this.currentScope.getDeclaredTypeOf(THIS_ID),new QualifiedName(THIS_ID));
      }
 else {
        lvalResult=new LValueResultFwd(inEnv,UNKNOWN,null,null);
      }
      break;
    }
case NAME:
{
    String varName=expr.getString();
    JSType varType=analyzeExprFwd(expr,inEnv).type;
    lvalResult=new LValueResultFwd(inEnv,varType,this.currentScope.getDeclaredTypeOf(varName),varType.hasNonScalar() ? new QualifiedName(varName) : null);
    break;
  }
case GETPROP:
case GETELEM:
{
  Node obj=expr.getFirstChild();
  Node prop=expr.getLastChild();
  QualifiedName pname=expr.isGetProp() || prop.isString() ? new QualifiedName(prop.getString()) : null;
  LValueResultFwd recvLvalue=analyzeReceiverLvalFwd(obj,pname,inEnv,requiredType);
  if (!recvLvalue.type.isSubtypeOf(TOP_OBJECT)) {
    EnvTypePair pair=analyzeExprFwd(prop,recvLvalue.env,requiredType);
    lvalResult=new LValueResultFwd(pair.env,requiredType,null,null);
    break;
  }
  JSType indexType=recvLvalue.type.getIndexType();
  if (expr.isGetElem() && indexType != null) {
    lvalResult=analyzeIObjectElmLvalFwd(prop,recvLvalue,indexType);
    break;
  }
  if (expr.isGetProp() || prop.isString()) {
    lvalResult=analyzePropLValFwd(obj,pname,recvLvalue,requiredType,insideQualifiedName);
    break;
  }
  EnvTypePair pair=analyzeExprFwd(expr,recvLvalue.env,requiredType);
  lvalResult=new LValueResultFwd(pair.env,pair.type,null,null);
  break;
}
case VAR:
{
checkState(expr.getParent().isForIn() || expr.getParent().isForOf());
Node vdecl=expr.getFirstChild();
String name=vdecl.getString();
checkState(!vdecl.hasChildren());
if (expr.getParent().isForIn()) {
  return new LValueResultFwd(inEnv,STRING,null,new QualifiedName(name));
}
 else {
  JSType declType=this.currentScope.getDeclaredTypeOf(name);
  return new LValueResultFwd(inEnv,requiredType,declType,new QualifiedName(name));
}
}
default :
{
checkState(insideQualifiedName);
EnvTypePair pair=analyzeExprFwd(expr,inEnv,requiredType);
return new LValueResultFwd(pair.env,pair.type,null,null);
}
}
maybeSetTypeI(expr,lvalResult.type);
mayWarnAboutUnknownType(expr,lvalResult.type);
return lvalResult;
}

Fixed version (ground truth):
private LValueResultFwd analyzeLValueFwd(Node expr,TypeEnv inEnv,JSType requiredType,boolean insideQualifiedName){
  LValueResultFwd lvalResult=null;
switch (expr.getToken()) {
case THIS:
{
      mayWarnAboutGlobalThis(expr);
      if (this.currentScope.hasThis()) {
        lvalResult=new LValueResultFwd(inEnv,envGetType(inEnv,THIS_ID),this.currentScope.getDeclaredTypeOf(THIS_ID),new QualifiedName(THIS_ID));
      }
 else {
        lvalResult=new LValueResultFwd(inEnv,UNKNOWN,null,null);
      }
      break;
    }
case NAME:
{
    String varName=expr.getString();
    JSType varType=analyzeExprFwd(expr,inEnv).type;
    lvalResult=new LValueResultFwd(inEnv,varType,this.currentScope.getDeclaredTypeOf(varName),varType.hasNonScalar() ? new QualifiedName(varName) : null);
    break;
  }
case GETPROP:
case GETELEM:
{
  Node obj=expr.getFirstChild();
  Node prop=expr.getLastChild();
  QualifiedName pname=expr.isGetProp() || prop.isString() ? new QualifiedName(prop.getString()) : null;
  LValueResultFwd recvLvalue=analyzeReceiverLvalFwd(obj,pname,inEnv,requiredType);
  if (!recvLvalue.type.isSubtypeOf(TOP_OBJECT)) {
    EnvTypePair pair=analyzeExprFwd(prop,recvLvalue.env,requiredType);
    lvalResult=new LValueResultFwd(pair.env,requiredType,null,null);
    break;
  }
  JSType indexType=recvLvalue.type.getIndexType();
  if (expr.isGetElem() && indexType != null) {
    lvalResult=analyzeIObjectElmLvalFwd(prop,recvLvalue,indexType);
    break;
  }
  if (expr.isGetProp() || prop.isString()) {
    lvalResult=analyzePropLValFwd(obj,pname,recvLvalue,requiredType,insideQualifiedName);
    break;
  }
  EnvTypePair pair=analyzeExprFwd(expr,recvLvalue.env,requiredType);
  lvalResult=new LValueResultFwd(pair.env,pair.type,null,null);
  break;
}
case VAR:
{
checkState(expr.getParent().isForIn() || expr.getParent().isForOf());
Node nameNode=expr.getFirstChild();
String name=nameNode.getString();
checkState(!nameNode.hasChildren());
maybeSetTypeI(nameNode,requiredType);
if (expr.getParent().isForIn()) {
  return new LValueResultFwd(inEnv,STRING,null,new QualifiedName(name));
}
 else {
  JSType declType=this.currentScope.getDeclaredTypeOf(name);
  return new LValueResultFwd(inEnv,requiredType,declType,new QualifiedName(name));
}
}
default :
{
checkState(insideQualifiedName);
EnvTypePair pair=analyzeExprFwd(expr,inEnv,requiredType);
return new LValueResultFwd(pair.env,pair.type,null,null);
}
}
maybeSetTypeI(expr,lvalResult.type);
mayWarnAboutUnknownType(expr,lvalResult.type);
return lvalResult;
}