Buggy code:
private void generate ( Stmt . While s , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private void generate ( Stmt . DoWhile s , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private void generate ( Stmt . ForAll s , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } public void generateCondition ( String target , Expr condition , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private void generateCondition ( String target , Expr . Constant c , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private void generateCondition ( String target , Expr . BinOp v , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) throws Exception { } private void generateTypeCondition ( String target , Expr . BinOp condition , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) throws Exception { } private void generateCondition ( String target , Expr . UnOp v , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private void generateCondition ( String target , Expr . Quantifier e , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private void generate ( Iterator < Pair < String , Expr > > srcIterator , String trueLabel , String falseLabel , Expr . Quantifier e , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } public int generate ( Expr expression , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } public int generate ( Expr . MethodCall expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) throws ResolveError { } public void generate ( Expr . MethodCall expr , int target , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) throws ResolveError { } public int generate ( Expr . FunctionCall expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) throws ResolveError { } public void generate ( Expr . FunctionCall expr , int target , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) throws ResolveError { } public int generate ( Expr . IndirectFunctionCall expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) throws ResolveError { } public void generate ( Expr . IndirectFunctionCall expr , int target , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) throws ResolveError { } public int generate ( Expr . IndirectMethodCall expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) throws ResolveError { } public void generate ( Expr . IndirectMethodCall expr , int target , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) throws ResolveError { } private int generate ( Expr . Constant expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private int generate ( Expr . FunctionOrMethod expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private int generate ( Expr . Lambda expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private int generate ( Expr . ConstantAccess expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) throws ResolveError { } private int generate ( Expr . LocalVariable expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) throws ResolveError { } private int generate ( Expr . UnOp expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private int generate ( Expr . LengthOf expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { int operand = generate ( expr . src , environment , codes , context ) ; int target = environment . allocate ( expr . result ( ) . raw ( ) ) ; <START_BUG> codes . add ( Codes . LengthOf ( ( ( Type . List ) ( expr . srcType . raw ( ) ) ) , target , operand ) , CodeGenerator . attributes ( expr ) ) ; <END_BUG> return target ; } private int generate ( Expr . Dereference expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private int generate ( Expr . IndexOf expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private int generate ( Expr . Cast expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private int generate ( Expr . BinOp v , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) throws Exception { } private int generate ( Expr . List expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private int generate ( Expr . SubList expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private int generate ( Expr . Quantifier e , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private int generate ( Expr . Record expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private int generate ( Expr . Tuple expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private int generate ( Expr . FieldAccess expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { } private int generate ( Expr . New expr , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) throws ResolveError { } private int [ ] generate ( List < Expr > arguments , CodeGenerator . Environment environment , AttributedCodeBlock codes , Context context ) { }

Fix:
codes . add ( Codes . LengthOf ( ( ( Type . EffectiveList ) ( expr . srcType . raw ( ) ) ) , target , operand ) , CodeGenerator . attributes ( expr ) ) ;