Program: 27268
Project: 27268
Buggy source:
private LValueResultFwd analyzeLValueFwd(Node expr,TypeEnv inEnv,JSType type,boolean insideQualifiedName){
  LValueResultFwd lvalResult=null;
switch (expr.getToken()) {
case THIS:
{
      mayWarnAboutGlobalThis(expr,currentScope);
      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,type);
  if (!recvLvalue.type.isSubtypeOf(TOP_OBJECT)) {
    EnvTypePair pair=analyzeExprFwd(prop,recvLvalue.env,type);
    lvalResult=new LValueResultFwd(pair.env,type,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,type,insideQualifiedName);
    break;
  }
  EnvTypePair pair=analyzeExprFwd(expr,recvLvalue.env,type);
  lvalResult=new LValueResultFwd(pair.env,pair.type,null,null);
  break;
}
case VAR:
{
Preconditions.checkState(expr.getParent().isForIn());
Node vdecl=expr.getFirstChild();
String name=vdecl.getString();
Preconditions.checkState(!vdecl.hasChildren());
return new LValueResultFwd(inEnv,STRING,null,new QualifiedName(name));
}
default :
{
Preconditions.checkState(insideQualifiedName);
EnvTypePair pair=analyzeExprFwd(expr,inEnv,type);
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 type,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,type);
  if (!recvLvalue.type.isSubtypeOf(TOP_OBJECT)) {
    EnvTypePair pair=analyzeExprFwd(prop,recvLvalue.env,type);
    lvalResult=new LValueResultFwd(pair.env,type,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,type,insideQualifiedName);
    break;
  }
  EnvTypePair pair=analyzeExprFwd(expr,recvLvalue.env,type);
  lvalResult=new LValueResultFwd(pair.env,pair.type,null,null);
  break;
}
case VAR:
{
Preconditions.checkState(expr.getParent().isForIn());
Node vdecl=expr.getFirstChild();
String name=vdecl.getString();
Preconditions.checkState(!vdecl.hasChildren());
return new LValueResultFwd(inEnv,STRING,null,new QualifiedName(name));
}
default :
{
Preconditions.checkState(insideQualifiedName);
EnvTypePair pair=analyzeExprFwd(expr,inEnv,type);
return new LValueResultFwd(pair.env,pair.type,null,null);
}
}
maybeSetTypeI(expr,lvalResult.type);
mayWarnAboutUnknownType(expr,lvalResult.type);
return lvalResult;
}