diff --git a/src/Compilers/CSharp/Portable/Emitter/EditAndContinue/PEDeltaAssemblyBuilder.cs b/src/Compilers/CSharp/Portable/Emitter/EditAndContinue/PEDeltaAssemblyBuilder.cs index 29d9e47fd17ad..ffbf411f38694 100644 --- a/src/Compilers/CSharp/Portable/Emitter/EditAndContinue/PEDeltaAssemblyBuilder.cs +++ b/src/Compilers/CSharp/Portable/Emitter/EditAndContinue/PEDeltaAssemblyBuilder.cs @@ -306,11 +306,12 @@ private SynthesizedHotReloadExceptionSymbol GetOrCreateSynthesizedHotReloadExcep } var exceptionType = Compilation.GetWellKnownType(WellKnownType.System_Exception); + var actionOfTType = Compilation.GetWellKnownType(WellKnownType.System_Action_T); var stringType = Compilation.GetSpecialType(SpecialType.System_String); var intType = Compilation.GetSpecialType(SpecialType.System_Int32); var containingNamespace = GetOrSynthesizeNamespace(SynthesizedHotReloadExceptionSymbol.NamespaceName); - symbol = new SynthesizedHotReloadExceptionSymbol(containingNamespace, exceptionType, stringType, intType); + symbol = new SynthesizedHotReloadExceptionSymbol(containingNamespace, exceptionType, actionOfTType, stringType, intType); Interlocked.CompareExchange(ref _lazyHotReloadExceptionType, symbol, comparand: null); return _lazyHotReloadExceptionType; diff --git a/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedHotReloadExceptionConstructorSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedHotReloadExceptionConstructorSymbol.cs index 7af8299ab93d2..4c94fc6a92bac 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedHotReloadExceptionConstructorSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedHotReloadExceptionConstructorSymbol.cs @@ -52,15 +52,47 @@ internal override void GenerateMethodBody(TypeCompilationState compilationState, return; } + var delegateInvoke = (containingType.CreatedActionField.Type as NamedTypeSymbol)?.DelegateInvokeMethod; + if (delegateInvoke is null || + delegateInvoke.ReturnType.SpecialType != SpecialType.System_Void || + delegateInvoke.GetParameters() is not [{ RefKind: RefKind.None } parameter] || + !parameter.Type.Equals(exceptionConstructor.ContainingType)) + { + diagnostics.Add(ErrorCode.ERR_EncUpdateFailedMissingSymbol, + Location.None, + CodeAnalysisResources.Method, + "void System.Action.Invoke(T arg)"); + + factory.CloseMethod(factory.Block()); + return; + } + + var actionTemp = factory.StoreToTemp( + factory.Field(receiver: null, containingType.CreatedActionField), + out var storeAction); + var block = factory.Block( - ImmutableArray.Create( - factory.ExpressionStatement(factory.Call( - factory.This(), - exceptionConstructor, - factory.Parameter(MessageParameter))), - factory.Assignment(factory.Field(factory.This(), containingType.CodeField), factory.Parameter(CodeParameter)), - factory.Return() - )); + [actionTemp.LocalSymbol], + + // base(message) + factory.ExpressionStatement(factory.Call( + factory.This(), + exceptionConstructor, + factory.Parameter(MessageParameter))), + + // this.CodeField = code; + factory.Assignment(factory.Field(factory.This(), containingType.CodeField), factory.Parameter(CodeParameter)), + + // s_created?.Invoke(this); + factory.If( + factory.IsNotNullReference(storeAction), + factory.ExpressionStatement( + factory.Call( + actionTemp, + delegateInvoke, + factory.This()))), + + factory.Return()); factory.CloseMethod(block); } diff --git a/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedHotReloadExceptionSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedHotReloadExceptionSymbol.cs index 71783a598a78c..55300e9b13bed 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedHotReloadExceptionSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedHotReloadExceptionSymbol.cs @@ -22,6 +22,12 @@ internal sealed class SynthesizedHotReloadExceptionSymbol : NamedTypeSymbol public const string TypeName = "HotReloadException"; public const string CodeFieldName = "Code"; + /// + /// The Hot Reload agent that's injected into the application needs to intercept creation of a runtime rude edit. + /// It uses reflection to set this action field. + /// + public const string CreatedActionFieldName = "Created"; + private readonly NamedTypeSymbol _baseType; private readonly NamespaceSymbol _namespace; @@ -31,6 +37,7 @@ internal sealed class SynthesizedHotReloadExceptionSymbol : NamedTypeSymbol public SynthesizedHotReloadExceptionSymbol( NamespaceSymbol containingNamespace, NamedTypeSymbol exceptionType, + NamedTypeSymbol actionOfTType, TypeSymbol stringType, TypeSymbol intType) { @@ -40,7 +47,8 @@ public SynthesizedHotReloadExceptionSymbol( _members = [ new SynthesizedHotReloadExceptionConstructorSymbol(this, stringType, intType), - new SynthesizedFieldSymbol(this, intType, CodeFieldName, DeclarationModifiers.Public, isReadOnly: true, isStatic: false) + new SynthesizedFieldSymbol(this, intType, CodeFieldName, DeclarationModifiers.Public, isReadOnly: true, isStatic: false), + new SynthesizedFieldSymbol(this, actionOfTType.Construct(exceptionType), CreatedActionFieldName, DeclarationModifiers.Private, isReadOnly: false, isStatic: true) ]; } @@ -50,6 +58,9 @@ public MethodSymbol Constructor public FieldSymbol CodeField => (FieldSymbol)_members[1]; + public FieldSymbol CreatedActionField + => (FieldSymbol)_members[2]; + public override ImmutableArray GetMembers() => _members; @@ -58,6 +69,7 @@ public override ImmutableArray GetMembers(string name) { WellKnownMemberNames.InstanceConstructorName => [Constructor], CodeFieldName => [CodeField], + CreatedActionFieldName => [CreatedActionField], _ => [] }; @@ -65,7 +77,7 @@ public override IEnumerable MemberNames => _members.Select(static m => m.Name); internal override IEnumerable GetFieldsToEmit() - => [CodeField]; + => [CodeField, CreatedActionField]; public override ImmutableArray GetTypeMembers() => []; public override ImmutableArray GetTypeMembers(ReadOnlyMemory name) => []; diff --git a/src/Compilers/CSharp/Test/Emit2/Emit/EditAndContinue/EditAndContinueClosureTests.cs b/src/Compilers/CSharp/Test/Emit2/Emit/EditAndContinue/EditAndContinueClosureTests.cs index 452b56111a29e..4814a60d42080 100644 --- a/src/Compilers/CSharp/Test/Emit2/Emit/EditAndContinue/EditAndContinueClosureTests.cs +++ b/src/Compilers/CSharp/Test/Emit2/Emit/EditAndContinue/EditAndContinueClosureTests.cs @@ -4855,7 +4855,7 @@ .maxstack 2 IL_0006: nop IL_0007: ldloc.1 IL_0008: ldc.i4.1 - IL_0009: stfld 0x04000005 + IL_0009: stfld 0x04000006 IL_000e: nop IL_000f: ldsfld 0x04000003 IL_0014: brtrue.s IL_002b @@ -4885,8 +4885,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A00000B @@ -4894,14 +4894,22 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000004 - IL_000f: ret + IL_000f: ldsfld 0x04000005 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000C + IL_001f: nop + IL_0020: ret } .ctor { // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call 0x0A00000C + IL_0001: call 0x0A00000D IL_0006: nop IL_0007: ret } @@ -4910,7 +4918,7 @@ .maxstack 8 // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000005 + IL_0001: ldfld 0x04000006 IL_0006: call 0x0A00000A IL_000b: nop IL_000c: ret @@ -5000,7 +5008,7 @@ .maxstack 2 IL_0000: nop IL_0001: ldloca.s V_1 IL_0003: ldc.i4.1 - IL_0004: stfld 0x04000002 + IL_0004: stfld 0x04000003 IL_0009: nop IL_000a: nop IL_000b: ret @@ -5028,15 +5036,15 @@ .maxstack 8 // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000002 + IL_0001: ldfld 0x04000003 IL_0006: call 0x0A000008 IL_000b: nop IL_000c: ret } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -5044,7 +5052,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } """); }) @@ -5110,7 +5126,7 @@ .maxstack 2 IL_0005: stloc.0 IL_0006: ldloc.0 IL_0007: ldarg.1 - IL_0008: stfld 0x04000005 + IL_0008: stfld 0x04000006 IL_000d: nop IL_000e: nop IL_000f: ldsfld 0x04000003 @@ -5141,8 +5157,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A00000B @@ -5150,14 +5166,22 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000004 - IL_000f: ret + IL_000f: ldsfld 0x04000005 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000C + IL_001f: nop + IL_0020: ret } .ctor { // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call 0x0A00000C + IL_0001: call 0x0A00000D IL_0006: nop IL_0007: ret } @@ -5166,7 +5190,7 @@ .maxstack 8 // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000005 + IL_0001: ldfld 0x04000006 IL_0006: call 0x0A00000A IL_000b: nop IL_000c: ret @@ -5252,7 +5276,7 @@ public void F(int x) .maxstack 2 IL_0000: ldloca.s V_0 IL_0002: ldarg.1 - IL_0003: stfld 0x04000002 + IL_0003: stfld 0x04000003 IL_0008: nop IL_0009: nop IL_000a: nop @@ -5281,15 +5305,15 @@ .maxstack 8 // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000002 + IL_0001: ldfld 0x04000003 IL_0006: call 0x0A000008 IL_000b: nop IL_000c: ret } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -5297,7 +5321,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } """); }) @@ -5381,7 +5413,7 @@ .maxstack 2 IL_0005: stloc.0 IL_0006: ldloc.0 IL_0007: ldarg.1 - IL_0008: stfld 0x04000005 + IL_0008: stfld 0x04000006 IL_000d: ldloc.0 IL_000e: ldftn 0x0600000A IL_0014: newobj 0x0A00000A @@ -5399,8 +5431,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A00000B @@ -5408,14 +5440,22 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000004 - IL_000f: ret + IL_000f: ldsfld 0x04000005 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000C + IL_001f: nop + IL_0020: ret } .ctor { // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call 0x0A00000C + IL_0001: call 0x0A00000D IL_0006: nop IL_0007: ret } @@ -5424,7 +5464,7 @@ .maxstack 8 // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000005 + IL_0001: ldfld 0x04000006 IL_0006: ret } """); @@ -5492,10 +5532,10 @@ .maxstack 3 IL_0005: stloc.0 IL_0006: ldloc.0 IL_0007: ldarg.1 - IL_0008: stfld 0x04000005 + IL_0008: stfld 0x04000006 IL_000d: ldloc.0 IL_000e: ldarg.2 - IL_000f: stfld 0x04000006 + IL_000f: stfld 0x04000007 IL_0014: ldarg.0 IL_0015: ldloc.0 IL_0016: ldftn 0x06000009 @@ -5526,8 +5566,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A00000B @@ -5535,14 +5575,22 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000004 - IL_000f: ret + IL_000f: ldsfld 0x04000005 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000C + IL_001f: nop + IL_0020: ret } .ctor { // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call 0x0A00000C + IL_0001: call 0x0A00000D IL_0006: nop IL_0007: ret } @@ -5551,7 +5599,7 @@ .maxstack 8 // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000005 + IL_0001: ldfld 0x04000006 IL_0006: ret } <.ctor>b__1#1 @@ -5559,8 +5607,8 @@ .maxstack 8 // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000006 - IL_0006: call 0x0A00000D + IL_0001: ldfld 0x04000007 + IL_0006: call 0x0A00000E IL_000b: nop IL_000c: ret } @@ -5616,7 +5664,7 @@ .maxstack 3 IL_0005: stloc.0 IL_0006: ldloc.0 IL_0007: ldarg.1 - IL_0008: stfld 0x04000004 + IL_0008: stfld 0x04000005 IL_000d: ldarg.0 IL_000e: ldloc.0 IL_000f: ldftn 0x06000008 @@ -5636,8 +5684,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -5645,14 +5693,22 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000003 - IL_000f: ret + IL_000f: ldsfld 0x04000004 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } .ctor { // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call 0x0A00000A + IL_0001: call 0x0A00000B IL_0006: nop IL_0007: ret } @@ -5661,7 +5717,7 @@ .maxstack 8 // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000004 + IL_0001: ldfld 0x04000005 IL_0006: ret } """); @@ -5716,7 +5772,7 @@ .maxstack 2 IL_0005: stloc.1 IL_0006: ldloc.1 IL_0007: ldarg.0 - IL_0008: stfld 0x04000004 + IL_0008: stfld 0x04000005 IL_000d: ldloc.1 IL_000e: ldftn 0x06000008 IL_0014: newobj 0x0A000008 @@ -5734,8 +5790,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -5743,14 +5799,22 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000003 - IL_000f: ret + IL_000f: ldsfld 0x04000004 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } .ctor { // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call 0x0A00000A + IL_0001: call 0x0A00000B IL_0006: nop IL_0007: ret } @@ -5759,7 +5823,7 @@ .maxstack 8 // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000004 + IL_0001: ldfld 0x04000005 IL_0006: ret } """); @@ -5888,8 +5952,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A00000B @@ -5897,7 +5961,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000005 - IL_000f: ret + IL_000f: ldsfld 0x04000006 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000C + IL_001f: nop + IL_0020: ret } """); }) @@ -6018,8 +6090,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -6027,7 +6099,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000002 - IL_000f: ret + IL_000f: ldsfld 0x04000003 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } """); }) @@ -6128,8 +6208,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A00000C @@ -6137,7 +6217,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000005 - IL_000f: ret + IL_000f: ldsfld 0x04000006 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000D + IL_001f: nop + IL_0020: ret } """); }) @@ -6230,8 +6318,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A00000A @@ -6239,7 +6327,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000002 - IL_000f: ret + IL_000f: ldsfld 0x04000003 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000B + IL_001f: nop + IL_0020: ret } """); }) @@ -6512,12 +6608,12 @@ .maxstack 2 IL_0000: nop IL_0001: ldc.i4.1 IL_0002: stloc.1 - IL_0003: ldsfld 0x04000004 + IL_0003: ldsfld 0x04000005 IL_0008: brtrue.s IL_001f - IL_000a: ldsfld 0x04000003 + IL_000a: ldsfld 0x04000004 IL_000f: ldftn 0x06000008 IL_0015: newobj 0x0A000008 - IL_001a: stsfld 0x04000004 + IL_001a: stsfld 0x04000005 IL_001f: ret } b__0 @@ -6531,8 +6627,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -6540,14 +6636,22 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000002 - IL_000f: ret + IL_000f: ldsfld 0x04000003 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } .cctor { // Code size 11 (0xb) .maxstack 8 IL_0000: newobj 0x06000007 - IL_0005: stsfld 0x04000003 + IL_0005: stsfld 0x04000004 IL_000a: ret } .ctor @@ -6555,7 +6659,7 @@ .maxstack 8 // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call 0x0A00000A + IL_0001: call 0x0A00000B IL_0006: nop IL_0007: ret } @@ -6564,7 +6668,7 @@ .maxstack 8 // Code size 8 (0x8) .maxstack 8 IL_0000: ldc.i4.2 - IL_0001: call 0x0A00000B + IL_0001: call 0x0A00000C IL_0006: nop IL_0007: ret } @@ -6611,7 +6715,7 @@ .maxstack 2 IL_0006: nop IL_0007: ldloc.2 IL_0008: ldc.i4.1 - IL_0009: stfld 0x04000005 + IL_0009: stfld 0x04000006 IL_000e: nop IL_000f: ret } @@ -6629,7 +6733,7 @@ .maxstack 8 // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call 0x0A00000D + IL_0001: call 0x0A00000E IL_0006: nop IL_0007: ret } @@ -6638,10 +6742,10 @@ .maxstack 8 // Code size 15 (0xf) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000005 + IL_0001: ldfld 0x04000006 IL_0006: ldc.i4.3 IL_0007: add - IL_0008: call 0x0A00000E + IL_0008: call 0x0A00000F IL_000d: nop IL_000e: ret } @@ -6789,8 +6893,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -6798,7 +6902,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000003 - IL_000f: ret + IL_000f: ldsfld 0x04000004 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } """); }) @@ -6907,12 +7019,12 @@ public void F() // Code size 58 (0x3a) .maxstack 8 IL_0000: nop - IL_0001: ldsfld 0x04000005 + IL_0001: ldsfld 0x04000006 IL_0006: brtrue.s IL_001d IL_0008: ldsfld 0x04000002 IL_000d: ldftn 0x06000008 IL_0013: newobj 0x0A000009 - IL_0018: stsfld 0x04000005 + IL_0018: stsfld 0x04000006 IL_001d: ldsfld 0x04000003 IL_0022: brtrue.s IL_0039 IL_0024: ldsfld 0x04000002 @@ -6941,8 +7053,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A00000B @@ -6950,7 +7062,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000004 - IL_000f: ret + IL_000f: ldsfld 0x04000005 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000C + IL_001f: nop + IL_0020: ret } b__1_0#1 { @@ -7098,8 +7218,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -7107,7 +7227,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000002 - IL_000f: ret + IL_000f: ldsfld 0x04000003 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } """); }) @@ -7220,7 +7348,7 @@ public void F() "C.<>c__DisplayClass0#1_0#1: {x, b__0#1}"); // is emitted as a definition in this generation - g.VerifyTypeRefNames("Object", "CompilerGeneratedAttribute", "Exception"); + g.VerifyTypeRefNames("Object", "CompilerGeneratedAttribute", "Exception", "Action`1"); g.VerifyMethodDefNames("F", "b__0#1", ".ctor"); @@ -7245,8 +7373,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -7254,7 +7382,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000002 - IL_000f: ret + IL_000f: ldsfld 0x04000003 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } """); }) @@ -7376,8 +7512,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000008 @@ -7385,7 +7521,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000002 - IL_000f: ret + IL_000f: ldsfld 0x04000003 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000009 + IL_001f: nop + IL_0020: ret } """); }) @@ -7493,14 +7637,14 @@ .maxstack 3 IL_0014: stloc.2 IL_0015: ldloc.2 IL_0016: ldloc.0 - IL_0017: stfld 0x04000005 + IL_0017: stfld 0x04000006 IL_001c: nop IL_001d: ldloc.2 IL_001e: ldc.i4.0 - IL_001f: stfld 0x04000004 + IL_001f: stfld 0x04000005 IL_0024: ldarg.0 IL_0025: ldloc.2 - IL_0026: ldfld 0x04000005 + IL_0026: ldfld 0x04000006 IL_002b: ldftn 0x06000005 IL_0031: newobj 0x0A000008 IL_0036: call 0x06000001 @@ -7534,8 +7678,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -7543,14 +7687,22 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000003 - IL_000f: ret + IL_000f: ldsfld 0x04000004 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } .ctor { // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call 0x0A00000A + IL_0001: call 0x0A00000B IL_0006: nop IL_0007: ret } @@ -7559,10 +7711,10 @@ .maxstack 8 // Code size 19 (0x13) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000005 + IL_0001: ldfld 0x04000006 IL_0006: ldfld 0x04000001 IL_000b: ldarg.0 - IL_000c: ldfld 0x04000004 + IL_000c: ldfld 0x04000005 IL_0011: add IL_0012: ret } @@ -7726,8 +7878,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000007 @@ -7735,7 +7887,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000003 - IL_000f: ret + IL_000f: ldsfld 0x04000004 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000008 + IL_001f: nop + IL_0020: ret } """); }) @@ -7845,7 +8005,7 @@ .maxstack 2 IL_0015: nop IL_0016: ldloc.2 IL_0017: ldc.i4.0 - IL_0018: stfld 0x04000005 + IL_0018: stfld 0x04000006 IL_001d: ldloc.0 IL_001e: ldftn 0x06000005 IL_0024: newobj 0x0A000008 @@ -7879,8 +8039,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -7888,14 +8048,22 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000004 - IL_000f: ret + IL_000f: ldsfld 0x04000005 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } .ctor { // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call 0x0A00000A + IL_0001: call 0x0A00000B IL_0006: nop IL_0007: ret } @@ -7904,7 +8072,7 @@ .maxstack 8 // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000005 + IL_0001: ldfld 0x04000006 IL_0006: ret } """); @@ -8067,8 +8235,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000007 @@ -8076,7 +8244,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000003 - IL_000f: ret + IL_000f: ldsfld 0x04000004 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000008 + IL_001f: nop + IL_0020: ret } """); }) @@ -8178,23 +8354,23 @@ .maxstack 2 IL_0014: stloc.3 IL_0015: ldloc.3 IL_0016: ldloc.0 - IL_0017: stfld 0x04000006 + IL_0017: stfld 0x04000007 IL_001c: nop IL_001d: ldloc.3 IL_001e: ldc.i4.2 - IL_001f: stfld 0x04000005 + IL_001f: stfld 0x04000006 IL_0024: newobj 0x0600000A IL_0029: stloc.s V_4 IL_002b: ldloc.s V_4 IL_002d: ldloc.3 - IL_002e: stfld 0x04000008 + IL_002e: stfld 0x04000009 IL_0033: nop IL_0034: ldloc.s V_4 IL_0036: ldc.i4.3 - IL_0037: stfld 0x04000007 + IL_0037: stfld 0x04000008 IL_003c: ldloc.s V_4 - IL_003e: ldfld 0x04000008 - IL_0043: ldfld 0x04000006 + IL_003e: ldfld 0x04000009 + IL_0043: ldfld 0x04000007 IL_0048: ldftn 0x06000005 IL_004e: newobj 0x0A000008 IL_0053: call 0x06000001 @@ -8233,8 +8409,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -8242,14 +8418,22 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000004 - IL_000f: ret + IL_000f: ldsfld 0x04000005 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } .ctor, .ctor { // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call 0x0A00000A + IL_0001: call 0x0A00000B IL_0006: nop IL_0007: ret } @@ -8258,10 +8442,10 @@ .maxstack 8 // Code size 24 (0x18) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000007 + IL_0001: ldfld 0x04000008 IL_0006: ldarg.0 - IL_0007: ldfld 0x04000008 - IL_000c: ldfld 0x04000006 + IL_0007: ldfld 0x04000009 + IL_000c: ldfld 0x04000007 IL_0011: ldfld 0x04000001 IL_0016: add IL_0017: ret @@ -8271,15 +8455,15 @@ .maxstack 8 // Code size 36 (0x24) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000007 + IL_0001: ldfld 0x04000008 IL_0006: ldarg.0 - IL_0007: ldfld 0x04000008 - IL_000c: ldfld 0x04000006 + IL_0007: ldfld 0x04000009 + IL_000c: ldfld 0x04000007 IL_0011: ldfld 0x04000001 IL_0016: add IL_0017: ldarg.0 - IL_0018: ldfld 0x04000008 - IL_001d: ldfld 0x04000005 + IL_0018: ldfld 0x04000009 + IL_001d: ldfld 0x04000006 IL_0022: add IL_0023: ret } @@ -8644,8 +8828,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -8653,7 +8837,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000003 - IL_000f: ret + IL_000f: ldsfld 0x04000004 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } b__2#1 { @@ -8843,8 +9035,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000007 @@ -8852,7 +9044,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000003 - IL_000f: ret + IL_000f: ldsfld 0x04000004 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000008 + IL_001f: nop + IL_0020: ret } """); }) @@ -8966,7 +9166,7 @@ .maxstack 2 IL_0000: nop IL_0001: ldloca.s V_2 IL_0003: ldc.i4.1 - IL_0004: stfld 0x04000004 + IL_0004: stfld 0x04000005 IL_0009: newobj 0x06000007 IL_000e: stloc.1 IL_000f: nop @@ -9018,13 +9218,13 @@ .maxstack 8 // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000004 + IL_0001: ldfld 0x04000005 IL_0006: ret } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -9032,7 +9232,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000003 - IL_000f: ret + IL_000f: ldsfld 0x04000004 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } b__2#1 { @@ -9219,8 +9427,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -9228,7 +9436,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000003 - IL_000f: ret + IL_000f: ldsfld 0x04000004 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } g__L3|2#1 { @@ -9418,10 +9634,10 @@ .maxstack 2 IL_0000: nop IL_0001: ldloca.s V_2 IL_0003: ldc.i4.1 - IL_0004: stfld 0x04000003 + IL_0004: stfld 0x04000004 IL_0009: ldloca.s V_2 IL_000b: ldc.i4.2 - IL_000c: stfld 0x04000004 + IL_000c: stfld 0x04000005 IL_0011: nop IL_0012: ret } @@ -9439,16 +9655,16 @@ .maxstack 8 // Code size 14 (0xe) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000003 + IL_0001: ldfld 0x04000004 IL_0006: ldarg.0 - IL_0007: ldfld 0x04000004 + IL_0007: ldfld 0x04000005 IL_000c: add IL_000d: ret } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000007 @@ -9456,7 +9672,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000002 - IL_000f: ret + IL_000f: ldsfld 0x04000003 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000008 + IL_001f: nop + IL_0020: ret } """); }) @@ -9643,7 +9867,7 @@ .maxstack 2 IL_0000: nop IL_0001: ldloca.s V_1 IL_0003: ldc.i4.1 - IL_0004: stfld 0x04000003 + IL_0004: stfld 0x04000004 IL_0009: nop IL_000a: ret } @@ -9670,13 +9894,13 @@ .maxstack 8 // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000003 + IL_0001: ldfld 0x04000004 IL_0006: ret } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000008 @@ -9684,19 +9908,30 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000002 - IL_000f: ret + IL_000f: ldsfld 0x04000003 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000009 + IL_001f: nop + IL_0020: ret } """); g.VerifyEncLogDefinitions( [ Row(2, TableIndex.StandAloneSig, EditAndContinueOperation.Default), + Row(3, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(5, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(2, TableIndex.Field, EditAndContinueOperation.Default), - Row(5, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(3, TableIndex.Field, EditAndContinueOperation.Default), + Row(5, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(4, TableIndex.Field, EditAndContinueOperation.Default), Row(2, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(5, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(6, TableIndex.MethodDef, EditAndContinueOperation.Default), @@ -9780,7 +10015,7 @@ .maxstack 2 IL_0000: nop IL_0001: ldloca.s V_1 IL_0003: ldc.i4.1 - IL_0004: stfld 0x04000003 + IL_0004: stfld 0x04000004 IL_0009: nop IL_000a: ret } @@ -9798,13 +10033,13 @@ .maxstack 8 // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000003 + IL_0001: ldfld 0x04000004 IL_0006: ret } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000008 @@ -9812,7 +10047,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000002 - IL_000f: ret + IL_000f: ldsfld 0x04000003 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000009 + IL_001f: nop + IL_0020: ret } """); }) @@ -9875,7 +10118,7 @@ public void F() "class C.<>c__DisplayClass1_0#1: {x, g__L|0#1, b__1#1}" ]); - g.VerifyTypeRefNames("Object", "CompilerGeneratedAttribute", "Exception", "Func`1"); + g.VerifyTypeRefNames("Object", "CompilerGeneratedAttribute", "Exception", "Action`1", "Func`1"); g.VerifyMethodDefNames("F", "g__L|1_0", ".ctor", ".ctor", "g__L|0#1", "b__1#1"); @@ -9889,7 +10132,7 @@ .maxstack 2 IL_0006: nop IL_0007: ldloc.1 IL_0008: ldc.i4.1 - IL_0009: stfld 0x04000003 + IL_0009: stfld 0x04000004 IL_000e: nop IL_000f: ldloc.1 IL_0010: ldftn 0x06000008 @@ -9909,8 +10152,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000008 @@ -9918,14 +10161,22 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000002 - IL_000f: ret + IL_000f: ldsfld 0x04000003 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000009 + IL_001f: nop + IL_0020: ret } .ctor { // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call 0x0A000009 + IL_0001: call 0x0A00000A IL_0006: nop IL_0007: ret } @@ -9934,7 +10185,7 @@ .maxstack 8 // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000003 + IL_0001: ldfld 0x04000004 IL_0006: ret } """); @@ -10000,7 +10251,7 @@ public void F() g.VerifyMethodDefNames("F", "g__L|1_0", ".ctor", ".ctor", "g__L|0#1"); - g.VerifyTypeRefNames("Object", "CompilerGeneratedAttribute", "Exception", "Func`1"); + g.VerifyTypeRefNames("Object", "CompilerGeneratedAttribute", "Exception", "Action`1", "Func`1"); g.VerifyIL( """ @@ -10013,7 +10264,7 @@ .maxstack 2 IL_0006: nop IL_0007: ldloc.1 IL_0008: ldc.i4.1 - IL_0009: stfld 0x04000003 + IL_0009: stfld 0x04000004 IL_000e: nop IL_000f: ldloc.1 IL_0010: ldftn 0x06000007 @@ -10033,8 +10284,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000008 @@ -10042,14 +10293,22 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000002 - IL_000f: ret + IL_000f: ldsfld 0x04000003 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000009 + IL_001f: nop + IL_0020: ret } .ctor { // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call 0x0A000009 + IL_0001: call 0x0A00000A IL_0006: nop IL_0007: ret } @@ -10058,7 +10317,7 @@ .maxstack 8 // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000003 + IL_0001: ldfld 0x04000004 IL_0006: ret } """); @@ -10127,12 +10386,12 @@ public void F() // Code size 30 (0x1e) .maxstack 8 IL_0000: nop - IL_0001: ldsfld 0x04000004 + IL_0001: ldsfld 0x04000005 IL_0006: brtrue.s IL_001d IL_0008: ldsfld 0x04000001 IL_000d: ldftn 0x06000007 IL_0013: newobj 0x0A000008 - IL_0018: stsfld 0x04000004 + IL_0018: stsfld 0x04000005 IL_001d: ret } b__0_0 @@ -10146,8 +10405,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -10155,7 +10414,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000003 - IL_000f: ret + IL_000f: ldsfld 0x04000004 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } b__0_0#1 { @@ -10199,12 +10466,12 @@ public void F() // Code size 30 (0x1e) .maxstack 8 IL_0000: nop - IL_0001: ldsfld 0x04000005 + IL_0001: ldsfld 0x04000006 IL_0006: brtrue.s IL_001d IL_0008: ldsfld 0x04000001 IL_000d: ldftn 0x06000008 - IL_0013: newobj 0x0A00000B - IL_0018: stsfld 0x04000005 + IL_0013: newobj 0x0A00000C + IL_0018: stsfld 0x04000006 IL_001d: ret } b__0_0#1 diff --git a/src/Compilers/CSharp/Test/Emit2/Emit/EditAndContinue/EditAndContinuePdbTests.cs b/src/Compilers/CSharp/Test/Emit2/Emit/EditAndContinue/EditAndContinuePdbTests.cs index 134c4c0ec6da4..5c454b41a1908 100644 --- a/src/Compilers/CSharp/Test/Emit2/Emit/EditAndContinue/EditAndContinuePdbTests.cs +++ b/src/Compilers/CSharp/Test/Emit2/Emit/EditAndContinue/EditAndContinuePdbTests.cs @@ -283,9 +283,12 @@ void G() CheckEncLogDefinitions(reader2, Row(5, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(6, TableIndex.StandAloneSig, EditAndContinueOperation.Default), + Row(7, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(6, TableIndex.Field, EditAndContinueOperation.Default), + Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(7, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(4, TableIndex.MethodDef, EditAndContinueOperation.Default), diff --git a/src/Compilers/CSharp/Test/Emit2/Emit/EditAndContinue/EditAndContinueTests.cs b/src/Compilers/CSharp/Test/Emit2/Emit/EditAndContinue/EditAndContinueTests.cs index a65c412c2381f..460706f17a02d 100644 --- a/src/Compilers/CSharp/Test/Emit2/Emit/EditAndContinue/EditAndContinueTests.cs +++ b/src/Compilers/CSharp/Test/Emit2/Emit/EditAndContinue/EditAndContinueTests.cs @@ -83,14 +83,17 @@ public C() (".ctor", MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName), (".ctor", MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName)); - g.VerifyTypeRefNames("Object", "CompilerGeneratedAttribute", "Exception"); - g.VerifyMemberRefNames(".ctor", ".ctor"); + g.VerifyTypeRefNames("Object", "CompilerGeneratedAttribute", "Exception", "Action`1"); + g.VerifyMemberRefNames(".ctor", ".ctor", "Invoke"); g.VerifyEncLogDefinitions(new[] { + Row(1, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(1, TableIndex.Field, EditAndContinueOperation.Default), + Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(2, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), Row(3, TableIndex.MethodDef, EditAndContinueOperation.Default), @@ -101,9 +104,11 @@ public C() { Handle(3, TableIndex.TypeDef), Handle(1, TableIndex.Field), + Handle(2, TableIndex.Field), Handle(2, TableIndex.MethodDef), Handle(3, TableIndex.MethodDef), - Handle(4, TableIndex.CustomAttribute) + Handle(4, TableIndex.CustomAttribute), + Handle(1, TableIndex.StandAloneSig) }); g.VerifyIL(""" @@ -118,8 +123,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000006 @@ -127,7 +132,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000007 + IL_001f: nop + IL_0020: ret } """); }) @@ -164,15 +177,20 @@ class C }, validator: g => { + g.VerifyTypeDefNames("HotReloadException"); + // The default constructor is added and the deleted constructor is updated to throw: g.VerifyMethodDefNames(".ctor", ".ctor", ".ctor"); - g.VerifyTypeRefNames("Object", "CompilerGeneratedAttribute", "Exception"); + g.VerifyTypeRefNames("Object", "CompilerGeneratedAttribute", "Exception", "Action`1"); g.VerifyEncLogDefinitions(new[] { + Row(1, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(1, TableIndex.Field, EditAndContinueOperation.Default), + Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), Row(2, TableIndex.MethodDef, EditAndContinueOperation.Default), @@ -180,14 +198,17 @@ class C Row(3, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(4, TableIndex.CustomAttribute, EditAndContinueOperation.Default) }); + g.VerifyEncMapDefinitions(new[] { Handle(3, TableIndex.TypeDef), Handle(1, TableIndex.Field), + Handle(2, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(2, TableIndex.MethodDef), Handle(3, TableIndex.MethodDef), - Handle(4, TableIndex.CustomAttribute) + Handle(4, TableIndex.CustomAttribute), + Handle(1, TableIndex.StandAloneSig) }); g.VerifyIL(""" @@ -211,8 +232,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000007 @@ -220,7 +241,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000008 + IL_001f: nop + IL_0020: ret } """); }) @@ -2541,16 +2570,20 @@ void F() "System.Runtime.CompilerServices.HotReloadException", "C: {<>c}", "C.<>c: {<>9__0_1, b__0_1}"); + g.VerifyTypeDefNames("HotReloadException"); g.VerifyMethodDefNames("F", "b__0_0", "b__0_1", ".ctor"); - g.VerifyTypeRefNames("Object", "CompilerGeneratedAttribute", "Exception", "Action", "Console"); - g.VerifyMemberRefNames(".ctor", ".ctor", "WriteLine", ".ctor"); + g.VerifyTypeRefNames("Object", "CompilerGeneratedAttribute", "Exception", "Action`1", "Action", "Console"); + g.VerifyMemberRefNames(".ctor", ".ctor", "WriteLine", ".ctor", "Invoke"); g.VerifyEncLogDefinitions(new[] { + Row(1, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(4, TableIndex.Field, EditAndContinueOperation.Default), + Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(5, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(5, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(6, TableIndex.MethodDef, EditAndContinueOperation.Default), @@ -2562,11 +2595,13 @@ void F() { Handle(4, TableIndex.TypeDef), Handle(4, TableIndex.Field), + Handle(5, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(5, TableIndex.MethodDef), Handle(6, TableIndex.MethodDef), Handle(7, TableIndex.MethodDef), - Handle(5, TableIndex.CustomAttribute) + Handle(5, TableIndex.CustomAttribute), + Handle(1, TableIndex.StandAloneSig) }); g.VerifyIL(""" @@ -2603,8 +2638,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A00000B @@ -2612,7 +2647,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000004 - IL_000f: ret + IL_000f: ldsfld 0x04000005 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000C + IL_001f: nop + IL_0020: ret } """); }) @@ -2923,7 +2966,7 @@ .maxstack 2 IL_0006: nop IL_0007: ldloc.0 IL_0008: ldc.i4.5 - IL_0009: stfld 0x04000003 + IL_0009: stfld 0x04000004 IL_000e: ldloc.0 IL_000f: ldftn 0x06000007 IL_0015: newobj 0x0A000008 @@ -2941,8 +2984,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -2950,14 +2993,22 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000002 - IL_000f: ret + IL_000f: ldsfld 0x04000003 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } .ctor { // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call 0x0A00000A + IL_0001: call 0x0A00000B IL_0006: nop IL_0007: ret } @@ -2966,7 +3017,7 @@ .maxstack 8 // Code size 9 (0x9) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000003 + IL_0001: ldfld 0x04000004 IL_0006: ldc.i4.4 IL_0007: add IL_0008: ret @@ -4260,6 +4311,7 @@ class C validator: g => { g.VerifyTypeDefNames("HotReloadException"); + g.VerifyMethodDefNames("get_P", "set_P", ".ctor"); g.VerifyPropertyDefNames("P"); @@ -4271,9 +4323,12 @@ class C g.VerifyEncLogDefinitions(new[] { + Row(1, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(2, TableIndex.Field, EditAndContinueOperation.Default), + Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(3, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), @@ -4289,6 +4344,7 @@ class C { Handle(4, TableIndex.TypeDef), Handle(2, TableIndex.Field), + Handle(3, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(2, TableIndex.MethodDef), Handle(5, TableIndex.MethodDef), @@ -4296,6 +4352,7 @@ class C Handle(7, TableIndex.CustomAttribute), Handle(9, TableIndex.CustomAttribute), Handle(10, TableIndex.CustomAttribute), + Handle(1, TableIndex.StandAloneSig), Handle(1, TableIndex.Property) }); @@ -4311,8 +4368,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A00000A @@ -4320,7 +4377,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000002 - IL_000f: ret + IL_000f: ldsfld 0x04000003 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000B + IL_001f: nop + IL_0020: ret } """); }) @@ -4362,7 +4427,7 @@ class C Handle(10, TableIndex.CustomAttribute), Handle(1, TableIndex.Property), Handle(3, TableIndex.MethodSemantics), - Handle(4, TableIndex.MethodSemantics), + Handle(4, TableIndex.MethodSemantics) }); g.VerifyCustomAttributes( @@ -4426,15 +4491,18 @@ class C validator: g => { g.VerifyTypeDefNames("HotReloadException"); - g.VerifyFieldDefNames("Code"); + g.VerifyFieldDefNames("Code", "Created"); g.VerifyMethodDefNames("get_P", "set_P", ".ctor"); g.VerifyPropertyDefNames("P"); g.VerifyEncLogDefinitions( [ + Row(2, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(1, TableIndex.Field, EditAndContinueOperation.Default), + Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), @@ -4447,10 +4515,12 @@ class C [ Handle(3, TableIndex.TypeDef), Handle(1, TableIndex.Field), + Handle(2, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(2, TableIndex.MethodDef), Handle(4, TableIndex.MethodDef), Handle(4, TableIndex.CustomAttribute), + Handle(2, TableIndex.StandAloneSig), Handle(1, TableIndex.Property) ]); @@ -4466,8 +4536,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000006 @@ -4475,7 +4545,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000007 + IL_001f: nop + IL_0020: ret } """); }) @@ -4499,7 +4577,7 @@ class C g.VerifyEncLogDefinitions( [ Row(2, TableIndex.TypeDef, EditAndContinueOperation.AddField), - Row(2, TableIndex.Field, EditAndContinueOperation.Default), + Row(3, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(1, TableIndex.Property, EditAndContinueOperation.Default), @@ -4513,7 +4591,7 @@ class C ]); g.VerifyEncMapDefinitions( [ - Handle(2, TableIndex.Field), + Handle(3, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(2, TableIndex.MethodDef), Handle(1, TableIndex.Param), @@ -4532,7 +4610,7 @@ class C // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x04000002 + IL_0001: ldfld 0x04000003 IL_0006: ret } set_P @@ -4541,7 +4619,7 @@ .maxstack 8 .maxstack 8 IL_0000: ldarg.0 IL_0001: ldarg.1 - IL_0002: stfld 0x04000002 + IL_0002: stfld 0x04000003 IL_0007: ret } """); @@ -4585,9 +4663,12 @@ class C g.VerifyEncLogDefinitions(new[] { + Row(2, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(1, TableIndex.Field, EditAndContinueOperation.Default), + Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), @@ -4595,14 +4676,17 @@ class C Row(1, TableIndex.Property, EditAndContinueOperation.Default), Row(4, TableIndex.CustomAttribute, EditAndContinueOperation.Default) }); + g.VerifyEncMapDefinitions(new[] { Handle(3, TableIndex.TypeDef), Handle(1, TableIndex.Field), + Handle(2, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(2, TableIndex.MethodDef), Handle(4, TableIndex.MethodDef), Handle(4, TableIndex.CustomAttribute), + Handle(2, TableIndex.StandAloneSig), Handle(1, TableIndex.Property) }); @@ -4618,8 +4702,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000006 @@ -4627,7 +4711,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000007 + IL_001f: nop + IL_0020: ret } """); }) @@ -4651,7 +4743,7 @@ class C g.VerifyMemberRefNames(); g.VerifyEncLogDefinitions(new[] { - Row(2, TableIndex.StandAloneSig, EditAndContinueOperation.Default), + Row(3, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(1, TableIndex.Property, EditAndContinueOperation.Default), @@ -4664,7 +4756,7 @@ class C Handle(1, TableIndex.MethodDef), Handle(2, TableIndex.MethodDef), Handle(1, TableIndex.Param), - Handle(2, TableIndex.StandAloneSig), + Handle(3, TableIndex.StandAloneSig), Handle(1, TableIndex.Property), Handle(3, TableIndex.MethodSemantics), Handle(4, TableIndex.MethodSemantics), @@ -4726,24 +4818,31 @@ class C { g.VerifyTypeDefNames("HotReloadException"); g.VerifyMethodDefNames("set_P", ".ctor"); - g.VerifyMemberRefNames(/* Exception */ ".ctor", /* CompilerGeneratedAttribute */ ".ctor"); + g.VerifyMemberRefNames(/* Exception */ ".ctor", /* CompilerGeneratedAttribute */ ".ctor", "Invoke"); + g.VerifyEncLogDefinitions(new[] { + Row(2, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(1, TableIndex.Field, EditAndContinueOperation.Default), + Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(2, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), Row(4, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(4, TableIndex.CustomAttribute, EditAndContinueOperation.Default) }); + g.VerifyEncMapDefinitions(new[] { Handle(3, TableIndex.TypeDef), Handle(1, TableIndex.Field), + Handle(2, TableIndex.Field), Handle(2, TableIndex.MethodDef), Handle(4, TableIndex.MethodDef), - Handle(4, TableIndex.CustomAttribute) + Handle(4, TableIndex.CustomAttribute), + Handle(2, TableIndex.StandAloneSig) }); g.VerifyIL(""" @@ -4758,8 +4857,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000006 @@ -4767,7 +4866,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000007 + IL_001f: nop + IL_0020: ret } """); }) @@ -4790,7 +4897,7 @@ class C g.VerifyMethodDefNames("get_P", "set_P"); g.VerifyEncLogDefinitions(new[] { - Row(2, TableIndex.StandAloneSig, EditAndContinueOperation.Default), + Row(3, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(1, TableIndex.Property, EditAndContinueOperation.Default), @@ -4803,7 +4910,7 @@ class C Handle(1, TableIndex.MethodDef), Handle(2, TableIndex.MethodDef), Handle(1, TableIndex.Param), - Handle(2, TableIndex.StandAloneSig), + Handle(3, TableIndex.StandAloneSig), Handle(1, TableIndex.Property), Handle(3, TableIndex.MethodSemantics), Handle(4, TableIndex.MethodSemantics), @@ -5133,11 +5240,14 @@ class C g.VerifyEncLogDefinitions(new[] { + Row(1, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(2, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(3, TableIndex.Field, EditAndContinueOperation.Default), + Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(4, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), @@ -5162,11 +5272,13 @@ class C Row(3, TableIndex.MethodSemantics, EditAndContinueOperation.Default), Row(4, TableIndex.MethodSemantics, EditAndContinueOperation.Default) }); + g.VerifyEncMapDefinitions(new[] { Handle(4, TableIndex.TypeDef), Handle(2, TableIndex.Field), Handle(3, TableIndex.Field), + Handle(4, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(2, TableIndex.MethodDef), Handle(5, TableIndex.MethodDef), @@ -5181,6 +5293,7 @@ class C Handle(12, TableIndex.CustomAttribute), Handle(13, TableIndex.CustomAttribute), Handle(14, TableIndex.CustomAttribute), + Handle(1, TableIndex.StandAloneSig), Handle(1, TableIndex.Property), Handle(2, TableIndex.Property), Handle(3, TableIndex.MethodSemantics), @@ -5216,8 +5329,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A00000B @@ -5225,7 +5338,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000003 - IL_000f: ret + IL_000f: ldsfld 0x04000004 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000C + IL_001f: nop + IL_0020: ret } """); }) @@ -5371,11 +5492,14 @@ class C g.VerifyEncLogDefinitions(new[] { + Row(1, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(2, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(3, TableIndex.Field, EditAndContinueOperation.Default), + Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(4, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), @@ -5405,6 +5529,7 @@ class C Handle(4, TableIndex.TypeDef), Handle(2, TableIndex.Field), Handle(3, TableIndex.Field), + Handle(4, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(2, TableIndex.MethodDef), Handle(5, TableIndex.MethodDef), @@ -5419,6 +5544,7 @@ class C Handle(12, TableIndex.CustomAttribute), Handle(13, TableIndex.CustomAttribute), Handle(14, TableIndex.CustomAttribute), + Handle(1, TableIndex.StandAloneSig), Handle(1, TableIndex.Property), Handle(2, TableIndex.Property), Handle(3, TableIndex.MethodSemantics), @@ -5454,8 +5580,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A00000B @@ -5463,7 +5589,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000003 - IL_000f: ret + IL_000f: ldsfld 0x04000004 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000C + IL_001f: nop + IL_0020: ret } """); }) @@ -5608,9 +5742,12 @@ class C g.VerifyEncLogDefinitions(new[] { + Row(2, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(1, TableIndex.Field, EditAndContinueOperation.Default), + Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), @@ -5626,6 +5763,7 @@ class C { Handle(4, TableIndex.TypeDef), Handle(1, TableIndex.Field), + Handle(2, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(2, TableIndex.MethodDef), Handle(5, TableIndex.MethodDef), @@ -5633,6 +5771,7 @@ class C Handle(7, TableIndex.CustomAttribute), Handle(8, TableIndex.CustomAttribute), Handle(9, TableIndex.CustomAttribute), + Handle(2, TableIndex.StandAloneSig), Handle(1, TableIndex.Property) }); @@ -5648,8 +5787,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -5657,7 +5796,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } """); }) @@ -5703,9 +5850,12 @@ class C g.VerifyEncLogDefinitions(new[] { Row(2, TableIndex.StandAloneSig, EditAndContinueOperation.Default), + Row(3, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(1, TableIndex.Field, EditAndContinueOperation.Default), + Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), Row(3, TableIndex.MethodDef, EditAndContinueOperation.Default), @@ -5723,12 +5873,14 @@ class C { Handle(3, TableIndex.TypeDef), Handle(1, TableIndex.Field), + Handle(2, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(3, TableIndex.MethodDef), Handle(4, TableIndex.MethodDef), Handle(2, TableIndex.Param), Handle(5, TableIndex.CustomAttribute), Handle(2, TableIndex.StandAloneSig), + Handle(3, TableIndex.StandAloneSig), Handle(1, TableIndex.Property), Handle(2, TableIndex.Property), Handle(2, TableIndex.MethodSemantics) @@ -5756,9 +5908,9 @@ .maxstack 1 IL_0006: ret } .ctor - { - // Code size 16 (0x10) - .maxstack 8 + { + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000008 @@ -5766,7 +5918,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000009 + IL_001f: nop + IL_0020: ret } """); }) @@ -5792,7 +5952,7 @@ class C g.VerifyEncLogDefinitions(new[] { - Row(3, TableIndex.StandAloneSig, EditAndContinueOperation.Default), + Row(4, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(3, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(1, TableIndex.Property, EditAndContinueOperation.Default), @@ -5800,12 +5960,13 @@ class C Row(1, TableIndex.Param, EditAndContinueOperation.Default), Row(3, TableIndex.MethodSemantics, EditAndContinueOperation.Default) }); + g.VerifyEncMapDefinitions(new[] { Handle(1, TableIndex.MethodDef), Handle(3, TableIndex.MethodDef), Handle(1, TableIndex.Param), - Handle(3, TableIndex.StandAloneSig), + Handle(4, TableIndex.StandAloneSig), Handle(1, TableIndex.Property), Handle(2, TableIndex.Property), Handle(3, TableIndex.MethodSemantics), @@ -5857,17 +6018,18 @@ class C // existing property and getter are updated: g.VerifyEncLogDefinitions(new[] { - Row(4, TableIndex.StandAloneSig, EditAndContinueOperation.Default), + Row(5, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(3, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.Property, EditAndContinueOperation.Default), Row(2, TableIndex.Param, EditAndContinueOperation.Default), Row(4, TableIndex.MethodSemantics, EditAndContinueOperation.Default) }); + g.VerifyEncMapDefinitions(new[] { Handle(3, TableIndex.MethodDef), Handle(2, TableIndex.Param), - Handle(4, TableIndex.StandAloneSig), + Handle(5, TableIndex.StandAloneSig), Handle(2, TableIndex.Property), Handle(4, TableIndex.MethodSemantics) }); @@ -6132,7 +6294,7 @@ class C { g.VerifyTypeDefNames("HotReloadException"); g.VerifyMethodDefNames("add_E", "remove_E", ".ctor"); - g.VerifyTypeRefNames("Object", "EventHandler", "CompilerGeneratedAttribute", "Exception"); + g.VerifyTypeRefNames("Object", "EventHandler", "CompilerGeneratedAttribute", "Exception", "Action`1"); g.VerifyEventDefNames("E"); g.VerifyCustomAttributes( @@ -6143,10 +6305,13 @@ class C g.VerifyEncLogDefinitions(new[] { + Row(2, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(1, TableIndex.Event, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(2, TableIndex.Field, EditAndContinueOperation.Default), + Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(3, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), @@ -6161,6 +6326,7 @@ class C { Handle(4, TableIndex.TypeDef), Handle(2, TableIndex.Field), + Handle(3, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(2, TableIndex.MethodDef), Handle(5, TableIndex.MethodDef), @@ -6168,6 +6334,7 @@ class C Handle(7, TableIndex.CustomAttribute), Handle(9, TableIndex.CustomAttribute), Handle(10, TableIndex.CustomAttribute), + Handle(2, TableIndex.StandAloneSig), Handle(1, TableIndex.Event) }); @@ -6183,8 +6350,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A00000D @@ -6192,7 +6359,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000002 - IL_000f: ret + IL_000f: ldsfld 0x04000003 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000E + IL_001f: nop + IL_0020: ret } """); }) @@ -6240,7 +6415,7 @@ class C { g.VerifyTypeDefNames("HotReloadException"); g.VerifyMethodDefNames("add_E", "remove_E", ".ctor"); - g.VerifyTypeRefNames("Object", "EventHandler", "CompilerGeneratedAttribute", "Exception"); + g.VerifyTypeRefNames("Object", "EventHandler", "CompilerGeneratedAttribute", "Exception", "Action`1"); g.VerifyCustomAttributes( [ @@ -6252,10 +6427,13 @@ class C g.VerifyEncLogDefinitions(new[] { + Row(2, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(1, TableIndex.Event, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(2, TableIndex.Field, EditAndContinueOperation.Default), + Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(3, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), @@ -6269,12 +6447,14 @@ class C { Handle(3, TableIndex.TypeDef), Handle(2, TableIndex.Field), + Handle(3, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(2, TableIndex.MethodDef), Handle(4, TableIndex.MethodDef), Handle(1, TableIndex.CustomAttribute), Handle(7, TableIndex.CustomAttribute), Handle(8, TableIndex.CustomAttribute), + Handle(2, TableIndex.StandAloneSig), Handle(1, TableIndex.Event) }); @@ -6290,8 +6470,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A00000B @@ -6299,7 +6479,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000002 - IL_000f: ret + IL_000f: ldsfld 0x04000003 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000C + IL_001f: nop + IL_0020: ret } """); }) @@ -6358,6 +6546,7 @@ class C g.VerifyEncLogDefinitions(new[] { Row(2, TableIndex.StandAloneSig, EditAndContinueOperation.Default), + Row(3, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(1, TableIndex.Event, EditAndContinueOperation.Default), Row(1, TableIndex.EventMap, EditAndContinueOperation.AddEvent), @@ -6366,6 +6555,8 @@ class C Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(3, TableIndex.Field, EditAndContinueOperation.Default), + Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(4, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), @@ -6395,6 +6586,7 @@ class C Handle(4, TableIndex.TypeDef), Handle(2, TableIndex.Field), Handle(3, TableIndex.Field), + Handle(4, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(2, TableIndex.MethodDef), Handle(5, TableIndex.MethodDef), @@ -6411,6 +6603,7 @@ class C Handle(13, TableIndex.CustomAttribute), Handle(14, TableIndex.CustomAttribute), Handle(2, TableIndex.StandAloneSig), + Handle(3, TableIndex.StandAloneSig), Handle(1, TableIndex.Event), Handle(2, TableIndex.Event), Handle(3, TableIndex.MethodSemantics), @@ -6479,8 +6672,8 @@ .maxstack 3 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000011 @@ -6488,7 +6681,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000003 - IL_000f: ret + IL_000f: ldsfld 0x04000004 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000012 + IL_001f: nop + IL_0020: ret } """); }) @@ -6524,7 +6725,7 @@ class C g.VerifyEncLogDefinitions(new[] { - Row(3, TableIndex.StandAloneSig, EditAndContinueOperation.Default), + Row(4, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(1, TableIndex.Event, EditAndContinueOperation.Default), Row(2, TableIndex.Event, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), @@ -6557,7 +6758,7 @@ class C Handle(13, TableIndex.CustomAttribute), Handle(14, TableIndex.CustomAttribute), Handle(15, TableIndex.CustomAttribute), - Handle(3, TableIndex.StandAloneSig), + Handle(4, TableIndex.StandAloneSig), Handle(1, TableIndex.Event), Handle(2, TableIndex.Event), Handle(5, TableIndex.MethodSemantics), @@ -6576,8 +6777,8 @@ .maxstack 3 IL_0008: stloc.1 IL_0009: ldloc.1 IL_000a: ldarg.1 - IL_000b: call 0x0A000014 - IL_0010: castclass 0x01000018 + IL_000b: call 0x0A000015 + IL_0010: castclass 0x01000019 IL_0015: stloc.2 IL_0016: ldarg.0 IL_0017: ldflda 0x04000001 @@ -6601,8 +6802,8 @@ .maxstack 3 IL_0008: stloc.1 IL_0009: ldloc.1 IL_000a: ldarg.1 - IL_000b: call 0x0A000016 - IL_0010: castclass 0x01000018 + IL_000b: call 0x0A000017 + IL_0010: castclass 0x01000019 IL_0015: stloc.2 IL_0016: ldarg.0 IL_0017: ldflda 0x04000001 @@ -12798,13 +12999,16 @@ class C { g.VerifyTypeDefNames("HotReloadException"); g.VerifyMethodDefNames("op_LogicalNot", ".ctor"); - g.VerifyMemberRefNames(/* Exception */ ".ctor", /* CompilerGeneratedAttribute */ ".ctor"); + g.VerifyMemberRefNames(/* Exception */ ".ctor", /* CompilerGeneratedAttribute */ ".ctor", "Invoke"); g.VerifyEncLogDefinitions( [ + Row(1, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(1, TableIndex.Field, EditAndContinueOperation.Default), + Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), Row(3, TableIndex.MethodDef, EditAndContinueOperation.Default), @@ -12815,9 +13019,11 @@ class C [ Handle(3, TableIndex.TypeDef), Handle(1, TableIndex.Field), + Handle(2, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(3, TableIndex.MethodDef), - Handle(4, TableIndex.CustomAttribute) + Handle(4, TableIndex.CustomAttribute), + Handle(1, TableIndex.StandAloneSig) ]); g.VerifyIL(""" @@ -12832,8 +13038,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000006 @@ -12841,7 +13047,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000007 + IL_001f: nop + IL_0020: ret } """); }) @@ -16499,11 +16713,14 @@ public void Records_AddPrimaryConstructor() g.VerifyEncLogDefinitions(new[] { + Row(2, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(7, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(5, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(3, TableIndex.Field, EditAndContinueOperation.Default), Row(7, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(4, TableIndex.Field, EditAndContinueOperation.Default), + Row(7, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(5, TableIndex.Field, EditAndContinueOperation.Default), Row(15, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(5, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), Row(16, TableIndex.MethodDef, EditAndContinueOperation.Default), @@ -16949,6 +17166,57 @@ class C .Verify(); } + [Theory] + [InlineData("")] + [InlineData("public delegate void Action(System.Exception arg);")] + [InlineData("public delegate void Action(T arg);")] + [InlineData("public delegate int Action(T arg);")] + [InlineData("public delegate void Action(int arg);")] + [InlineData("public delegate void Action(in T arg);")] + [InlineData("public delegate void Action(ref T arg);")] + [InlineData("public delegate void Action(out T arg);")] + [InlineData("public delegate void Action(T arg, int x);")] + public void Method_Delete_SynthesizedHotReloadException_MissingOrBadActionType(string actionDef) + { + var libs = $$""" + namespace System + { + public class Exception(string message); + {{actionDef}} + } + namespace System.Runtime.InteropServices + { + public class InAttribute; + } + """; + + using var _ = new EditAndContinueTest(targetFramework: TargetFramework.Minimal, verification: Verification.Skipped) + .AddBaseline( + source: """ + class C + { + void F() {} + } + """ + libs) + .AddGeneration( + // 1 + source: """ + class C + { + } + """ + libs, + edits: + [ + Edit(SemanticEditKind.Delete, symbolProvider: c => c.GetMember("C.F"), newSymbolProvider: c => c.GetMember("C")), + ], + expectedErrors: + [ + // error CS7043: Cannot emit update; method 'void System.Action.Invoke(T arg)' is missing. + Diagnostic(ErrorCode.ERR_EncUpdateFailedMissingSymbol).WithArguments("method", "void System.Action.Invoke(T arg)").WithLocation(1, 1) + ]) + .Verify(); + } + [Fact] public void Method_Delete_SynthesizedHotReloadException_MissingCompilerGeneratedAttribute() { @@ -16959,6 +17227,8 @@ public class Exception { public Exception(string message) {} } + + public delegate void Action(T arg); } """; @@ -16996,13 +17266,13 @@ class C .maxstack 8 IL_0000: ldstr 0x70000005 IL_0005: ldc.i4.s -2 - IL_0007: newobj 0x06000004 + IL_0007: newobj 0x06000008 IL_000c: throw } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x06000003 @@ -17010,7 +17280,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000002 + IL_001f: nop + IL_0020: ret } """); }) @@ -17319,19 +17597,13 @@ .maxstack 8 } [Theory] - [InlineData("void M1() { }")] - [InlineData("void M1(string s) { }")] - [InlineData("void M1(C c) { }")] + [InlineData("int M1(C c) { return 0; }")] [InlineData("C M1(C c) { return default; }")] - [InlineData("void M1(N n) { }")] [InlineData("C M1() { return default; }")] [InlineData("N M1() { return default; }")] - [InlineData("int M1(C c) { return 0; }")] - [InlineData("void M1(T t) { }")] - [InlineData("void M1(T t) where T : C { }")] [InlineData("T M1() { return default; }")] [InlineData("T M1() where T : C { return default; }")] - public void Method_Delete(string methodDef) + public void Method_Delete_ReturnValue(string methodDef) { using var _ = new EditAndContinueTest() .AddBaseline( @@ -17351,7 +17623,7 @@ class N g.VerifyMethodDefNames("M1", ".ctor", ".ctor"); }) - .AddGeneration( + .AddGeneration(// 1 source: """ class C { @@ -17368,12 +17640,16 @@ class N { g.VerifyTypeDefNames("HotReloadException"); g.VerifyMethodDefNames("M1", ".ctor"); - g.VerifyMemberRefNames(".ctor", ".ctor"); + g.VerifyMemberRefNames(".ctor", ".ctor", "Invoke"); + g.VerifyEncLogDefinitions( [ + Row(2, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(1, TableIndex.Field, EditAndContinueOperation.Default), + Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), Row(4, TableIndex.MethodDef, EditAndContinueOperation.Default), @@ -17384,9 +17660,11 @@ class N [ Handle(4, TableIndex.TypeDef), Handle(1, TableIndex.Field), + Handle(2, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(4, TableIndex.MethodDef), - Handle(4, TableIndex.CustomAttribute) + Handle(4, TableIndex.CustomAttribute), + Handle(2, TableIndex.StandAloneSig) ]); g.VerifyIL(""" @@ -17401,8 +17679,115 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) + // Code size 33 (0x21) + .maxstack 2 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: call 0x0A000006 + IL_0007: nop + IL_0008: ldarg.0 + IL_0009: ldarg.2 + IL_000a: stfld 0x04000001 + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000007 + IL_001f: nop + IL_0020: ret + } + """); + }) + .Verify(); + } + + [Theory] + [InlineData("void M1() { }")] + [InlineData("void M1(string s) { }")] + [InlineData("void M1(C c) { }")] + [InlineData("void M1(N n) { }")] + [InlineData("void M1(T t) { }")] + [InlineData("void M1(T t) where T : C { }")] + public void Method_Delete_Void(string methodDef) + { + using var _ = new EditAndContinueTest() + .AddBaseline( + source: $$""" + class C + { + {{methodDef}} + } + + class N + { + } + """, + validator: g => + { + g.VerifyTypeDefNames("", "C", "N"); + g.VerifyMethodDefNames("M1", ".ctor", ".ctor"); + }) + + .AddGeneration(// 1 + source: """ + class C + { + } + + class N + { + } + """, + edits: new[] { + Edit(SemanticEditKind.Delete, symbolProvider: c => c.GetMember("C.M1"), newSymbolProvider: c => c.GetMember("C")), + }, + validator: g => + { + g.VerifyTypeDefNames("HotReloadException"); + g.VerifyMethodDefNames("M1", ".ctor"); + g.VerifyMemberRefNames(".ctor", ".ctor", "Invoke"); + + g.VerifyEncLogDefinitions( + [ + Row(1, TableIndex.StandAloneSig, EditAndContinueOperation.Default), + Row(4, TableIndex.TypeDef, EditAndContinueOperation.Default), + Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(1, TableIndex.Field, EditAndContinueOperation.Default), + Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(2, TableIndex.Field, EditAndContinueOperation.Default), + Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), + Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), + Row(4, TableIndex.MethodDef, EditAndContinueOperation.Default), + Row(4, TableIndex.CustomAttribute, EditAndContinueOperation.Default) + ]); + + g.VerifyEncMapDefinitions( + [ + Handle(4, TableIndex.TypeDef), + Handle(1, TableIndex.Field), + Handle(2, TableIndex.Field), + Handle(1, TableIndex.MethodDef), + Handle(4, TableIndex.MethodDef), + Handle(4, TableIndex.CustomAttribute), + Handle(1, TableIndex.StandAloneSig) + ]); + + g.VerifyIL(""" + M1 + { + // Code size 13 (0xd) .maxstack 8 + IL_0000: ldstr 0x70000005 + IL_0005: ldc.i4.s -2 + IL_0007: newobj 0x06000004 + IL_000c: throw + } + .ctor + { + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000006 @@ -17410,7 +17795,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000007 + IL_001f: nop + IL_0020: ret } """); }) @@ -17489,9 +17882,12 @@ void M1() { } g.VerifyMethodDefNames("M2", ".ctor"); g.VerifyEncLogDefinitions(new[] { + Row(1, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(1, TableIndex.Field, EditAndContinueOperation.Default), + Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(3, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), Row(4, TableIndex.MethodDef, EditAndContinueOperation.Default), @@ -17502,9 +17898,11 @@ void M1() { } { Handle(3, TableIndex.TypeDef), Handle(1, TableIndex.Field), + Handle(2, TableIndex.Field), Handle(3, TableIndex.MethodDef), Handle(4, TableIndex.MethodDef), - Handle(4, TableIndex.CustomAttribute) + Handle(4, TableIndex.CustomAttribute), + Handle(1, TableIndex.StandAloneSig) }); g.VerifyIL(""" @@ -17519,8 +17917,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000006 @@ -17528,7 +17926,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000007 + IL_001f: nop + IL_0020: ret } """); }) @@ -17568,9 +17974,12 @@ class C g.VerifyMethodDefNames("M1", ".ctor"); g.VerifyEncLogDefinitions(new[] { + Row(1, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(1, TableIndex.Field, EditAndContinueOperation.Default), + Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), Row(3, TableIndex.MethodDef, EditAndContinueOperation.Default), @@ -17580,9 +17989,11 @@ class C { Handle(3, TableIndex.TypeDef), Handle(1, TableIndex.Field), + Handle(2, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(3, TableIndex.MethodDef), - Handle(4, TableIndex.CustomAttribute) + Handle(4, TableIndex.CustomAttribute), + Handle(1, TableIndex.StandAloneSig) }); g.VerifyIL(""" @@ -17597,8 +18008,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000006 @@ -17606,7 +18017,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000007 + IL_001f: nop + IL_0020: ret } """); }) @@ -17641,7 +18060,7 @@ class C .maxstack 8 IL_0000: nop IL_0001: ldc.i4.1 - IL_0002: call 0x0A000007 + IL_0002: call 0x0A000008 IL_0007: nop IL_0008: ret } @@ -17691,9 +18110,12 @@ class C g.VerifyMethodDefNames("M1", ".ctor"); g.VerifyEncLogDefinitions( [ + Row(1, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(6, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(6, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(1, TableIndex.Field, EditAndContinueOperation.Default), + Row(6, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(3, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(6, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), Row(6, TableIndex.MethodDef, EditAndContinueOperation.Default), @@ -17705,10 +18127,12 @@ class C [ Handle(6, TableIndex.TypeDef), Handle(1, TableIndex.Field), + Handle(2, TableIndex.Field), Handle(3, TableIndex.MethodDef), Handle(6, TableIndex.MethodDef), Handle(6, TableIndex.CustomAttribute), - Handle(8, TableIndex.CustomAttribute) + Handle(8, TableIndex.CustomAttribute), + Handle(1, TableIndex.StandAloneSig) ]); g.VerifyCustomAttributes( @@ -17729,8 +18153,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000008 @@ -17738,7 +18162,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000009 + IL_001f: nop + IL_0020: ret } """); }) @@ -17885,9 +18317,12 @@ void Goo() { } g.VerifyEncLogDefinitions(new[] { + Row(2, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(1, TableIndex.Field, EditAndContinueOperation.Default), + Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(4, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), Row(5, TableIndex.MethodDef, EditAndContinueOperation.Default), @@ -17899,10 +18334,12 @@ void Goo() { } { Handle(4, TableIndex.TypeDef), Handle(1, TableIndex.Field), + Handle(2, TableIndex.Field), Handle(4, TableIndex.MethodDef), Handle(5, TableIndex.MethodDef), Handle(5, TableIndex.CustomAttribute), - Handle(6, TableIndex.CustomAttribute) + Handle(6, TableIndex.CustomAttribute), + Handle(2, TableIndex.StandAloneSig) }); g.VerifyIL(""" @@ -17917,8 +18354,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000008 @@ -17926,7 +18363,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000009 + IL_001f: nop + IL_0020: ret } """); @@ -17951,7 +18396,7 @@ void Goo() { } g.VerifyEncLogDefinitions(new[] { - Row(2, TableIndex.StandAloneSig, EditAndContinueOperation.Default), + Row(3, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(4, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(1, TableIndex.Param, EditAndContinueOperation.Default), Row(6, TableIndex.CustomAttribute, EditAndContinueOperation.Default) @@ -17962,7 +18407,7 @@ void Goo() { } Handle(4, TableIndex.MethodDef), Handle(1, TableIndex.Param), Handle(6, TableIndex.CustomAttribute), - Handle(2, TableIndex.StandAloneSig) + Handle(3, TableIndex.StandAloneSig) }); g.VerifyIL(""" @@ -17972,7 +18417,7 @@ void Goo() { } .maxstack 1 IL_0000: nop IL_0001: ldc.i4.1 - IL_0002: call 0x0A000009 + IL_0002: call 0x0A00000A IL_0007: nop IL_0008: ldnull IL_0009: stloc.0 @@ -18023,14 +18468,17 @@ class C g.VerifyTypeDefNames("HotReloadException"); g.VerifyMethodDefNames("F", "b__0_0", ".ctor"); - g.VerifyTypeRefNames("Object", "CompilerGeneratedAttribute", "Exception"); - g.VerifyMemberRefNames(".ctor", ".ctor"); + g.VerifyTypeRefNames("Object", "CompilerGeneratedAttribute", "Exception", "Action`1"); + g.VerifyMemberRefNames(".ctor", ".ctor", "Invoke"); g.VerifyEncLogDefinitions(new[] { + Row(1, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(3, TableIndex.Field, EditAndContinueOperation.Default), + Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(4, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(5, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), @@ -18042,10 +18490,12 @@ class C { Handle(4, TableIndex.TypeDef), Handle(3, TableIndex.Field), + Handle(4, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(5, TableIndex.MethodDef), Handle(6, TableIndex.MethodDef), - Handle(5, TableIndex.CustomAttribute) + Handle(5, TableIndex.CustomAttribute), + Handle(1, TableIndex.StandAloneSig) }); g.VerifyIL(""" @@ -18069,8 +18519,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000009 @@ -18078,7 +18528,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000003 - IL_000f: ret + IL_000f: ldsfld 0x04000004 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000A + IL_001f: nop + IL_0020: ret } """); }) @@ -18110,7 +18568,7 @@ class C g.VerifyEncLogDefinitions(new[] { Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), - Row(4, TableIndex.Field, EditAndContinueOperation.Default), + Row(5, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(4, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), @@ -18119,7 +18577,7 @@ class C g.VerifyEncMapDefinitions(new[] { - Handle(4, TableIndex.Field), + Handle(5, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(4, TableIndex.MethodDef), Handle(7, TableIndex.MethodDef) @@ -18131,12 +18589,12 @@ class C // Code size 30 (0x1e) .maxstack 8 IL_0000: nop - IL_0001: ldsfld 0x04000004 + IL_0001: ldsfld 0x04000005 IL_0006: brtrue.s IL_001d IL_0008: ldsfld 0x04000001 IL_000d: ldftn 0x06000007 - IL_0013: newobj 0x0A00000B - IL_0018: stsfld 0x04000004 + IL_0013: newobj 0x0A00000C + IL_0018: stsfld 0x04000005 IL_001d: ret } .ctor @@ -18144,7 +18602,7 @@ .maxstack 8 // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call 0x0A00000C + IL_0001: call 0x0A00000D IL_0006: nop IL_0007: ret } @@ -18153,7 +18611,7 @@ .maxstack 8 // Code size 8 (0x8) .maxstack 8 IL_0000: ldc.i4.2 - IL_0001: call 0x0A00000D + IL_0001: call 0x0A00000E IL_0006: nop IL_0007: ret } @@ -18283,14 +18741,17 @@ class C g.VerifyTypeDefNames("HotReloadException"); g.VerifyMethodDefNames("F", "b__0#1_0#1", ".ctor"); - g.VerifyTypeRefNames("Object", "CompilerGeneratedAttribute", "Exception"); - g.VerifyMemberRefNames(".ctor", ".ctor"); + g.VerifyTypeRefNames("Object", "CompilerGeneratedAttribute", "Exception", "Action`1"); + g.VerifyMemberRefNames(".ctor", ".ctor", "Invoke"); g.VerifyEncLogDefinitions(new[] { + Row(1, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(3, TableIndex.Field, EditAndContinueOperation.Default), + Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(4, TableIndex.Field, EditAndContinueOperation.Default), Row(2, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(5, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(4, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), @@ -18302,10 +18763,12 @@ class C { Handle(4, TableIndex.TypeDef), Handle(3, TableIndex.Field), + Handle(4, TableIndex.Field), Handle(2, TableIndex.MethodDef), Handle(5, TableIndex.MethodDef), Handle(6, TableIndex.MethodDef), - Handle(5, TableIndex.CustomAttribute) + Handle(5, TableIndex.CustomAttribute), + Handle(1, TableIndex.StandAloneSig) }); g.VerifyIL(""" @@ -18329,8 +18792,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A00000A @@ -18338,7 +18801,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000003 - IL_000f: ret + IL_000f: ldsfld 0x04000004 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000B + IL_001f: nop + IL_0020: ret } """); }) @@ -18459,15 +18930,18 @@ class C g.VerifyMethodDefNames("F", "b__0_0", "b__0_1#1", "b__0_2#2", ".ctor"); // Note: InAttribute is a custom modifier included in the signature - g.VerifyTypeRefNames("Object", "InAttribute", "CompilerGeneratedAttribute", "Exception"); + g.VerifyTypeRefNames("Object", "InAttribute", "CompilerGeneratedAttribute", "Exception", "Action`1"); - g.VerifyMemberRefNames(".ctor", ".ctor"); + g.VerifyMemberRefNames(".ctor", ".ctor", "Invoke"); g.VerifyEncLogDefinitions(new[] { + Row(4, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(8, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(8, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(5, TableIndex.Field, EditAndContinueOperation.Default), + Row(8, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(6, TableIndex.Field, EditAndContinueOperation.Default), Row(5, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(9, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(10, TableIndex.MethodDef, EditAndContinueOperation.Default), @@ -18481,12 +18955,14 @@ class C { Handle(8, TableIndex.TypeDef), Handle(5, TableIndex.Field), + Handle(6, TableIndex.Field), Handle(5, TableIndex.MethodDef), Handle(9, TableIndex.MethodDef), Handle(10, TableIndex.MethodDef), Handle(11, TableIndex.MethodDef), Handle(12, TableIndex.MethodDef), - Handle(15, TableIndex.CustomAttribute) + Handle(15, TableIndex.CustomAttribute), + Handle(4, TableIndex.StandAloneSig) }); g.VerifyIL(""" @@ -18510,8 +18986,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000024 @@ -18519,7 +18995,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000005 - IL_000f: ret + IL_000f: ldsfld 0x04000006 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000025 + IL_001f: nop + IL_0020: ret } """); }) @@ -18560,20 +19044,20 @@ void F<[A]S>([A]T a, S b) where S : struct // Code size 30 (0x1e) .maxstack 8 IL_0000: nop - IL_0001: ldsfld 0x0A000026 + IL_0001: ldsfld 0x0A000027 IL_0006: brtrue.s IL_001d - IL_0008: ldsfld 0x0A000027 - IL_000d: ldftn 0x0A000028 - IL_0013: newobj 0x0A000029 - IL_0018: stsfld 0x0A000026 + IL_0008: ldsfld 0x0A000028 + IL_000d: ldftn 0x0A000029 + IL_0013: newobj 0x0A00002A + IL_0018: stsfld 0x0A000027 IL_001d: ret } .cctor { // Code size 11 (0xb) .maxstack 8 - IL_0000: newobj 0x0A00002A - IL_0005: stsfld 0x0A00002B + IL_0000: newobj 0x0A00002B + IL_0005: stsfld 0x0A00002C IL_000a: ret } .ctor @@ -18581,7 +19065,7 @@ .maxstack 8 // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call 0x0A00002C + IL_0001: call 0x0A00002D IL_0006: nop IL_0007: ret } @@ -18590,7 +19074,7 @@ .maxstack 8 // Code size 8 (0x8) .maxstack 8 IL_0000: ldc.i4.4 - IL_0001: call 0x0A00002D + IL_0001: call 0x0A00002E IL_0006: nop IL_0007: ret } @@ -18754,9 +19238,9 @@ class C g.VerifyTypeDefNames("HotReloadException"); g.VerifyMethodDefNames("F", "g__L|0_0", "g__M|0_1#1", ".ctor"); - g.VerifyTypeRefNames("Object", "CompilerGeneratedAttribute", "Exception"); + g.VerifyTypeRefNames("Object", "CompilerGeneratedAttribute", "Exception", "Action`1"); - g.VerifyMemberRefNames(".ctor", ".ctor"); + g.VerifyMemberRefNames(".ctor", ".ctor", "Invoke"); g.VerifyCustomAttributes( "[System.Runtime.CompilerServices.MetadataUpdateDeletedAttribute..ctor] C`1.F", @@ -18764,9 +19248,12 @@ class C g.VerifyEncLogDefinitions(new[] { + Row(1, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(8, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(8, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(1, TableIndex.Field, EditAndContinueOperation.Default), + Row(8, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(5, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(7, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(9, TableIndex.MethodDef, EditAndContinueOperation.Default), @@ -18782,6 +19269,7 @@ class C { Handle(8, TableIndex.TypeDef), Handle(1, TableIndex.Field), + Handle(2, TableIndex.Field), Handle(5, TableIndex.MethodDef), Handle(7, TableIndex.MethodDef), Handle(9, TableIndex.MethodDef), @@ -18789,7 +19277,8 @@ class C Handle(15, TableIndex.CustomAttribute), Handle(17, TableIndex.CustomAttribute), Handle(19, TableIndex.CustomAttribute), - Handle(20, TableIndex.CustomAttribute) + Handle(20, TableIndex.CustomAttribute), + Handle(1, TableIndex.StandAloneSig) }); g.VerifyIL(""" @@ -18813,8 +19302,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A00000E @@ -18822,7 +19311,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A00000F + IL_001f: nop + IL_0020: ret } """); }) @@ -18874,17 +19371,17 @@ ref readonly T O(ref readonly T b) { // Code size 29 (0x1d) .maxstack 2 - IL_0000: newobj 0x0A000010 + IL_0000: newobj 0x0A000011 IL_0005: stloc.0 IL_0006: ldloc.0 IL_0007: ldarg.1 - IL_0008: stfld 0x0A000011 + IL_0008: stfld 0x0A000012 IL_000d: nop IL_000e: nop IL_000f: ldloc.0 IL_0010: ldloc.0 - IL_0011: ldflda 0x0A000011 - IL_0016: callvirt 0x0A000012 + IL_0011: ldflda 0x0A000012 + IL_0016: callvirt 0x0A000013 IL_001b: pop IL_001c: ret } @@ -18900,7 +19397,7 @@ .maxstack 8 // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call 0x0A000013 + IL_0001: call 0x0A000014 IL_0006: nop IL_0007: ret } @@ -18922,8 +19419,8 @@ .maxstack 1 // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld 0x0A000011 - IL_0006: call 0x0A000014 + IL_0001: ldfld 0x0A000012 + IL_0006: call 0x0A000015 IL_000b: ret } """); @@ -19095,9 +19592,12 @@ class C g.VerifyEncLogDefinitions(new[] { + Row(1, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(1, TableIndex.Field, EditAndContinueOperation.Default), + Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), Row(3, TableIndex.MethodDef, EditAndContinueOperation.Default), @@ -19111,11 +19611,13 @@ class C { Handle(3, TableIndex.TypeDef), Handle(1, TableIndex.Field), + Handle(2, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(3, TableIndex.MethodDef), Handle(4, TableIndex.MethodDef), Handle(2, TableIndex.Param), - Handle(4, TableIndex.CustomAttribute) + Handle(4, TableIndex.CustomAttribute), + Handle(1, TableIndex.StandAloneSig) }); g.VerifyIL(""" @@ -19140,8 +19642,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000008 @@ -19149,7 +19651,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000009 + IL_001f: nop + IL_0020: ret } """); }) @@ -19192,7 +19702,7 @@ class C .maxstack 8 IL_0000: nop IL_0001: ldarga.s V_1 - IL_0003: call 0x0A000009 + IL_0003: call 0x0A00000A IL_0008: pop IL_0009: ret } @@ -19247,9 +19757,12 @@ class C g.VerifyEncLogDefinitions(new[] { Row(2, TableIndex.StandAloneSig, EditAndContinueOperation.Default), + Row(3, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(1, TableIndex.Field, EditAndContinueOperation.Default), + Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), Row(3, TableIndex.MethodDef, EditAndContinueOperation.Default), @@ -19264,12 +19777,14 @@ class C { Handle(3, TableIndex.TypeDef), Handle(1, TableIndex.Field), + Handle(2, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(3, TableIndex.MethodDef), Handle(4, TableIndex.MethodDef), Handle(2, TableIndex.Param), Handle(4, TableIndex.CustomAttribute), - Handle(2, TableIndex.StandAloneSig) + Handle(2, TableIndex.StandAloneSig), + Handle(3, TableIndex.StandAloneSig) }); g.VerifyIL(""" @@ -19295,8 +19810,8 @@ .maxstack 1 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000007 @@ -19304,7 +19819,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000008 + IL_001f: nop + IL_0020: ret } """); }) @@ -19328,17 +19851,18 @@ class C g.VerifyEncLogDefinitions(new[] { - Row(3, TableIndex.StandAloneSig, EditAndContinueOperation.Default), + Row(4, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(3, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(1, TableIndex.Param, EditAndContinueOperation.Default), }); + g.VerifyEncMapDefinitions(new[] { Handle(1, TableIndex.MethodDef), Handle(3, TableIndex.MethodDef), Handle(1, TableIndex.Param), - Handle(3, TableIndex.StandAloneSig) + Handle(4, TableIndex.StandAloneSig) }); g.VerifyIL(""" @@ -19348,7 +19872,7 @@ class C .maxstack 1 IL_0000: nop IL_0001: ldarga.s V_1 - IL_0003: call 0x0A000008 + IL_0003: call 0x0A000009 IL_0008: stloc.0 IL_0009: br.s IL_000b IL_000b: ldloc.0 @@ -19404,9 +19928,12 @@ class C g.VerifyEncLogDefinitions(new[] { + Row(1, TableIndex.StandAloneSig, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.Default), Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), Row(1, TableIndex.Field, EditAndContinueOperation.Default), + Row(3, TableIndex.TypeDef, EditAndContinueOperation.AddField), + Row(2, TableIndex.Field, EditAndContinueOperation.Default), Row(1, TableIndex.MethodDef, EditAndContinueOperation.Default), Row(2, TableIndex.TypeDef, EditAndContinueOperation.AddMethod), Row(3, TableIndex.MethodDef, EditAndContinueOperation.Default), @@ -19423,12 +19950,14 @@ class C { Handle(3, TableIndex.TypeDef), Handle(1, TableIndex.Field), + Handle(2, TableIndex.Field), Handle(1, TableIndex.MethodDef), Handle(3, TableIndex.MethodDef), Handle(4, TableIndex.MethodDef), Handle(2, TableIndex.Param), Handle(3, TableIndex.Param), - Handle(4, TableIndex.CustomAttribute) + Handle(4, TableIndex.CustomAttribute), + Handle(1, TableIndex.StandAloneSig) }); g.VerifyIL(""" @@ -19453,8 +19982,8 @@ .maxstack 8 } .ctor { - // Code size 16 (0x10) - .maxstack 8 + // Code size 33 (0x21) + .maxstack 2 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call 0x0A000008 @@ -19462,7 +19991,15 @@ .maxstack 8 IL_0008: ldarg.0 IL_0009: ldarg.2 IL_000a: stfld 0x04000001 - IL_000f: ret + IL_000f: ldsfld 0x04000002 + IL_0014: dup + IL_0015: stloc.0 + IL_0016: brfalse.s IL_0020 + IL_0018: ldloc.0 + IL_0019: ldarg.0 + IL_001a: callvirt 0x0A000009 + IL_001f: nop + IL_0020: ret } """); }) @@ -19504,7 +20041,7 @@ class C .maxstack 8 IL_0000: nop IL_0001: ldarga.s V_1 - IL_0003: call 0x0A000009 + IL_0003: call 0x0A00000A IL_0008: pop IL_0009: ret }