protected override void EmitRead(ProtoBuf.Compiler.CompilerContext ctx, ProtoBuf.Compiler.Local valueFrom) { if (arrayType.GetArrayRank() > 1) { return; } Type listType; #if NO_GENERICS listType = typeof(BasicList); #else listType = typeof (System.Collections.Generic.List<>).MakeGenericType(itemType); #endif if (nested) { ctx.LoadReaderWriter(); ctx.EmitCall(typeof (ProtoReader).GetMethod("ReadFieldHeader")); ctx.DiscardValue(); } using (Compiler.Local oldArr = AppendToCollection ? ctx.GetLocalWithValue(ExpectedType, valueFrom) : null) using (Compiler.Local newArr = new Compiler.Local(ctx, ExpectedType)) using (Compiler.Local list = new Compiler.Local(ctx, listType)) { ctx.EmitCtor(listType); ctx.StoreValue(list); EmitReadArray(ctx, list, oldArr, newArr, Tail, listType.GetMethod("Add"), listType); } }