From 1823fba783534a5621d51f0f98ee449aa72fe056 Mon Sep 17 00:00:00 2001 From: Charles Stoner Date: Tue, 9 Feb 2016 12:10:14 -0800 Subject: [PATCH] Ignore synthesized delegates in AnonymousTypeManager.GetAnonymousTypeMap --- .../LoweredDynamicOperationFactory.cs | 5 +- .../AnonymousTypeManager.Templates.cs | 58 ++---- .../Symbols/Synthesized/GeneratedNames.cs | 59 ++++-- .../Synthesized/SynthesizedContainer.cs | 1 - .../Synthesized/SynthesizedDelegateSymbol.cs | 5 +- .../EditAndContinueClosureTests.cs | 180 ++++++++++++++++++ .../AnonymousTypes/AnonymousTypeDescriptor.vb | 4 +- 7 files changed, 255 insertions(+), 57 deletions(-) diff --git a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LoweredDynamicOperationFactory.cs b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LoweredDynamicOperationFactory.cs index b4170d4ec97..f874cc4a8e1 100644 --- a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LoweredDynamicOperationFactory.cs +++ b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LoweredDynamicOperationFactory.cs @@ -754,8 +754,9 @@ internal FieldSymbol DefineCallSiteStorageSymbol(NamedTypeSymbol containerDefini } int parameterCount = delegateSignature.Length - (returnsVoid ? 0 : 1); - - return _factory.Compilation.AnonymousTypeManager.SynthesizeDelegate(parameterCount, byRefs, returnsVoid).Construct(delegateSignature); + int generation = _factory.CompilationState.ModuleBuilderOpt.CurrentGenerationOrdinal; + var synthesizedType = _factory.Compilation.AnonymousTypeManager.SynthesizeDelegate(parameterCount, byRefs, returnsVoid, generation); + return synthesizedType.Construct(delegateSignature); } internal BoundExpression GetArgumentInfo( diff --git a/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/AnonymousTypeManager.Templates.cs b/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/AnonymousTypeManager.Templates.cs index 4220c8ba695..3e5483f4744 100644 --- a/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/AnonymousTypeManager.Templates.cs +++ b/src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/AnonymousTypeManager.Templates.cs @@ -5,11 +5,8 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics; -using System.Linq; using System.Threading; -using Microsoft.CodeAnalysis.Collections; using Microsoft.CodeAnalysis.CSharp.Emit; -using Microsoft.CodeAnalysis.CSharp.Symbols; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.CSharp.Symbols @@ -37,45 +34,20 @@ private struct SynthesizedDelegateKey : IEquatable { private readonly BitVector _byRefs; private readonly ushort _parameterCount; - private readonly byte _returnsVoid; + private readonly bool _returnsVoid; + private readonly int _generation; - public SynthesizedDelegateKey(int parameterCount, BitVector byRefs, bool returnsVoid) + public SynthesizedDelegateKey(int parameterCount, BitVector byRefs, bool returnsVoid, int generation) { _parameterCount = (ushort)parameterCount; - _returnsVoid = (byte)(returnsVoid ? 1 : 0); + _returnsVoid = returnsVoid; + _generation = generation; _byRefs = byRefs; } - /// - /// Produces name of the synthesized delegate symbol that encodes the parameter byref-ness and return type of the delegate. - /// The arity is appended via `N suffix since in MetadataName calculation since the delegate is generic. - /// public string MakeTypeName() { - var pooledBuilder = PooledStringBuilder.GetInstance(); - pooledBuilder.Builder.Append(_returnsVoid != 0 ? "<>A" : "<>F"); - - if (!_byRefs.IsNull) - { - pooledBuilder.Builder.Append("{"); - - int i = 0; - foreach (int byRefIndex in _byRefs.Words()) - { - if (i > 0) - { - pooledBuilder.Builder.Append(","); - } - - pooledBuilder.Builder.AppendFormat("{0:x8}", byRefIndex); - i++; - } - - pooledBuilder.Builder.Append("}"); - Debug.Assert(i > 0); - } - - return pooledBuilder.ToStringAndFree(); + return GeneratedNames.MakeDynamicCallSiteDelegateName(_byRefs, _returnsVoid, _generation); } public override bool Equals(object obj) @@ -87,12 +59,15 @@ public bool Equals(SynthesizedDelegateKey other) { return _parameterCount == other._parameterCount && _returnsVoid == other._returnsVoid + && _generation == other._generation && _byRefs.Equals(other._byRefs); } public override int GetHashCode() { - return Hash.Combine((int)_parameterCount, Hash.Combine((int)_returnsVoid, _byRefs.GetHashCode())); + return Hash.Combine( + Hash.Combine((int)_parameterCount, _generation), + Hash.Combine(_returnsVoid.GetHashCode(), _byRefs.GetHashCode())); } } @@ -182,12 +157,12 @@ private void CheckSourceLocationSeen(AnonymousTypePublicSymbol anonymous) } } - internal SynthesizedDelegateSymbol SynthesizeDelegate(int parameterCount, BitVector byRefParameters, bool returnsVoid) + internal SynthesizedDelegateSymbol SynthesizeDelegate(int parameterCount, BitVector byRefParameters, bool returnsVoid, int generation) { // parameterCount doesn't include return type Debug.Assert(byRefParameters.IsNull || parameterCount == byRefParameters.Capacity); - var key = new SynthesizedDelegateKey(parameterCount, byRefParameters, returnsVoid); + var key = new SynthesizedDelegateKey(parameterCount, byRefParameters, returnsVoid, generation); SynthesizedDelegateValue result; if (this.SynthesizedDelegates.TryGetValue(key, out result)) @@ -405,14 +380,19 @@ internal static Microsoft.CodeAnalysis.Emit.AnonymousTypeKey GetAnonymousTypeKey internal IReadOnlyDictionary GetAnonymousTypeMap() { var result = new Dictionary(); - var templates = GetAllCreatedTemplates(); - foreach (AnonymousTypeTemplateSymbol template in templates) + var templates = ArrayBuilder.GetInstance(); + // Get anonymous types but not synthesized delegates. (Delegate types are + // not reused across generations since reuse would add complexity (such + // as parsing delegate type names from metadata) without a clear benefit.) + GetCreatedAnonymousTypeTemplates(templates); + foreach (var template in templates) { var nameAndIndex = template.NameAndIndex; var key = template.GetAnonymousTypeKey(); var value = new Microsoft.CodeAnalysis.Emit.AnonymousTypeValue(nameAndIndex.Name, nameAndIndex.Index, template); result.Add(key, value); } + templates.Free(); return result; } diff --git a/src/Compilers/CSharp/Portable/Symbols/Synthesized/GeneratedNames.cs b/src/Compilers/CSharp/Portable/Symbols/Synthesized/GeneratedNames.cs index 889c280173d..bb4de757d65 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Synthesized/GeneratedNames.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Synthesized/GeneratedNames.cs @@ -4,6 +4,7 @@ using System.Diagnostics; using System.Globalization; using System.Linq; +using System.Text; using Microsoft.CodeAnalysis.Collections; using Roslyn.Utilities; @@ -188,12 +189,7 @@ internal static string MakeLambdaCacheFieldName(int methodOrdinal, int generatio if (methodOrdinal >= 0) { builder.Append(methodOrdinal); - - if (methodGeneration > 0) - { - builder.Append(GenerationSeparator); - builder.Append(methodGeneration); - } + AppendOptionalGeneration(builder, methodGeneration); } if (entityOrdinal >= 0) @@ -204,18 +200,22 @@ internal static string MakeLambdaCacheFieldName(int methodOrdinal, int generatio } builder.Append(entityOrdinal); - - if (entityGeneration > 0) - { - builder.Append(GenerationSeparator); - builder.Append(entityGeneration); - } + AppendOptionalGeneration(builder, entityGeneration); } } return result.ToStringAndFree(); } + private static void AppendOptionalGeneration(StringBuilder builder, int generation) + { + if (generation > 0) + { + builder.Append(GenerationSeparator); + builder.Append(generation); + } + } + internal static string MakeHoistedLocalFieldName(SynthesizedLocalKind kind, int slotIndex, string localNameOpt = null) { Debug.Assert((localNameOpt != null) == (kind == SynthesizedLocalKind.UserDefined)); @@ -448,6 +448,41 @@ internal static string MakeDynamicCallSiteFieldName(int uniqueId) return "<>p__" + StringExtensions.GetNumeral(uniqueId); } + /// + /// Produces name of the synthesized delegate symbol that encodes the parameter byref-ness and return type of the delegate. + /// The arity is appended via `N suffix in MetadataName calculation since the delegate is generic. + /// + internal static string MakeDynamicCallSiteDelegateName(BitVector byRefs, bool returnsVoid, int generation) + { + var pooledBuilder = PooledStringBuilder.GetInstance(); + var builder = pooledBuilder.Builder; + + builder.Append(returnsVoid ? "<>A" : "<>F"); + + if (!byRefs.IsNull) + { + builder.Append("{"); + + int i = 0; + foreach (int byRefIndex in byRefs.Words()) + { + if (i > 0) + { + builder.Append(","); + } + + builder.AppendFormat("{0:x8}", byRefIndex); + i++; + } + + builder.Append("}"); + Debug.Assert(i > 0); + } + + AppendOptionalGeneration(builder, generation); + return pooledBuilder.ToStringAndFree(); + } + internal static string AsyncBuilderFieldName() { // Microsoft.VisualStudio.VIL.VisualStudioHost.AsyncReturnStackFrame depends on this name. diff --git a/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedContainer.cs b/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedContainer.cs index a42624fc5f9..dd7828f00da 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedContainer.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedContainer.cs @@ -5,7 +5,6 @@ using System.Collections.Immutable; using System.Diagnostics; using System.Runtime.InteropServices; -using Microsoft.CodeAnalysis.CSharp.Emit; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.CSharp.Symbols diff --git a/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedDelegateSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedDelegateSymbol.cs index ffb6a3127b8..2e2ea15dd36 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedDelegateSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedDelegateSymbol.cs @@ -8,13 +8,16 @@ namespace Microsoft.CodeAnalysis.CSharp.Symbols { + /// + /// Dynamic call-site delegate, for call-sites that do not + /// match System.Action or System.Func signatures. + /// internal sealed class SynthesizedDelegateSymbol : SynthesizedContainer { private readonly NamespaceOrTypeSymbol _containingSymbol; private readonly MethodSymbol _constructor; private readonly MethodSymbol _invoke; - // constructor for dynamic call-site delegate: public SynthesizedDelegateSymbol( NamespaceOrTypeSymbol containingSymbol, string name, diff --git a/src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueClosureTests.cs b/src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueClosureTests.cs index 5108074cde8..66f17370626 100644 --- a/src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueClosureTests.cs +++ b/src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueClosureTests.cs @@ -2850,5 +2850,185 @@ .maxstack 2 diff2.VerifyIL("C.F", expectedIL.Replace("<>", "2")); } + + [WorkItem(179990, "https://devdiv.visualstudio.com:443/defaultcollection/DevDiv/_workitems/edit/179990")] + [Fact] + public void SynthesizedDelegates() + { + var template = +@"class C +{ + static void F(dynamic d, out object x, object y) + { + <>; + } +}"; + var source0 = MarkedSource(template.Replace("<>", "d.F(out x, new { })")); + var source1 = MarkedSource(template.Replace("<>", "d.F(out x, new { y })")); + var source2 = MarkedSource(template.Replace("<>", "d.F(new { y }, out x)")); + + var compilation0 = CreateCompilationWithMscorlib(source0.Tree, options: ComSafeDebugDll, references: new[] { SystemCoreRef, CSharpRef }); + var compilation1 = compilation0.WithSource(source1.Tree); + var compilation2 = compilation1.WithSource(source2.Tree); + + var v0 = CompileAndVerify(compilation0); + var md0 = ModuleMetadata.CreateFromImage(v0.EmittedAssemblyData); + + var f0 = compilation0.GetMember("C.F"); + var f1 = compilation1.GetMember("C.F"); + var f2 = compilation2.GetMember("C.F"); + + var generation0 = EmitBaseline.CreateInitialBaseline(md0, v0.CreateSymReader().GetEncMethodDebugInfo); + v0.VerifyIL("C.F", +@"{ + // Code size 112 (0x70) + .maxstack 9 + IL_0000: nop + IL_0001: ldsfld ""System.Runtime.CompilerServices.CallSite<<>A{00000004}>> C.<>o__0.<>p__0"" + IL_0006: brfalse.s IL_000a + IL_0008: br.s IL_0053 + IL_000a: ldc.i4 0x100 + IL_000f: ldstr ""F"" + IL_0014: ldnull + IL_0015: ldtoken ""C"" + IL_001a: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" + IL_001f: ldc.i4.3 + IL_0020: newarr ""Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo"" + IL_0025: dup + IL_0026: ldc.i4.0 + IL_0027: ldc.i4.0 + IL_0028: ldnull + IL_0029: call ""Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create(Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfoFlags, string)"" + IL_002e: stelem.ref + IL_002f: dup + IL_0030: ldc.i4.1 + IL_0031: ldc.i4.s 17 + IL_0033: ldnull + IL_0034: call ""Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create(Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfoFlags, string)"" + IL_0039: stelem.ref + IL_003a: dup + IL_003b: ldc.i4.2 + IL_003c: ldc.i4.1 + IL_003d: ldnull + IL_003e: call ""Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create(Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfoFlags, string)"" + IL_0043: stelem.ref + IL_0044: call ""System.Runtime.CompilerServices.CallSiteBinder Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags, string, System.Collections.Generic.IEnumerable, System.Type, System.Collections.Generic.IEnumerable)"" + IL_0049: call ""System.Runtime.CompilerServices.CallSite<<>A{00000004}>> System.Runtime.CompilerServices.CallSite<<>A{00000004}>>.Create(System.Runtime.CompilerServices.CallSiteBinder)"" + IL_004e: stsfld ""System.Runtime.CompilerServices.CallSite<<>A{00000004}>> C.<>o__0.<>p__0"" + IL_0053: ldsfld ""System.Runtime.CompilerServices.CallSite<<>A{00000004}>> C.<>o__0.<>p__0"" + IL_0058: ldfld ""<>A{00000004}> System.Runtime.CompilerServices.CallSite<<>A{00000004}>>.Target"" + IL_005d: ldsfld ""System.Runtime.CompilerServices.CallSite<<>A{00000004}>> C.<>o__0.<>p__0"" + IL_0062: ldarg.0 + IL_0063: ldarg.1 + IL_0064: newobj ""<>f__AnonymousType0..ctor()"" + IL_0069: callvirt ""void <>A{00000004}>.Invoke(System.Runtime.CompilerServices.CallSite, dynamic, ref object, )"" + IL_006e: nop + IL_006f: ret +}"); + + var diff1 = compilation1.EmitDifference( + generation0, + ImmutableArray.Create( + new SemanticEdit(SemanticEditKind.Update, f0, f1, GetSyntaxMapFromMarkers(source0, source1), preserveLocalVariables: true))); + diff1.VerifyIL("C.F", +@"{ + // Code size 113 (0x71) + .maxstack 9 + IL_0000: nop + IL_0001: ldsfld ""System.Runtime.CompilerServices.CallSite<<>A{00000004}#1>> C.<>o__0#1.<>p__0"" + IL_0006: brfalse.s IL_000a + IL_0008: br.s IL_0053 + IL_000a: ldc.i4 0x100 + IL_000f: ldstr ""F"" + IL_0014: ldnull + IL_0015: ldtoken ""C"" + IL_001a: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" + IL_001f: ldc.i4.3 + IL_0020: newarr ""Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo"" + IL_0025: dup + IL_0026: ldc.i4.0 + IL_0027: ldc.i4.0 + IL_0028: ldnull + IL_0029: call ""Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create(Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfoFlags, string)"" + IL_002e: stelem.ref + IL_002f: dup + IL_0030: ldc.i4.1 + IL_0031: ldc.i4.s 17 + IL_0033: ldnull + IL_0034: call ""Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create(Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfoFlags, string)"" + IL_0039: stelem.ref + IL_003a: dup + IL_003b: ldc.i4.2 + IL_003c: ldc.i4.1 + IL_003d: ldnull + IL_003e: call ""Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create(Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfoFlags, string)"" + IL_0043: stelem.ref + IL_0044: call ""System.Runtime.CompilerServices.CallSiteBinder Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags, string, System.Collections.Generic.IEnumerable, System.Type, System.Collections.Generic.IEnumerable)"" + IL_0049: call ""System.Runtime.CompilerServices.CallSite<<>A{00000004}#1>> System.Runtime.CompilerServices.CallSite<<>A{00000004}#1>>.Create(System.Runtime.CompilerServices.CallSiteBinder)"" + IL_004e: stsfld ""System.Runtime.CompilerServices.CallSite<<>A{00000004}#1>> C.<>o__0#1.<>p__0"" + IL_0053: ldsfld ""System.Runtime.CompilerServices.CallSite<<>A{00000004}#1>> C.<>o__0#1.<>p__0"" + IL_0058: ldfld ""<>A{00000004}#1> System.Runtime.CompilerServices.CallSite<<>A{00000004}#1>>.Target"" + IL_005d: ldsfld ""System.Runtime.CompilerServices.CallSite<<>A{00000004}#1>> C.<>o__0#1.<>p__0"" + IL_0062: ldarg.0 + IL_0063: ldarg.1 + IL_0064: ldarg.2 + IL_0065: newobj ""<>f__AnonymousType1..ctor(object)"" + IL_006a: callvirt ""void <>A{00000004}#1>.Invoke(System.Runtime.CompilerServices.CallSite, dynamic, ref object, )"" + IL_006f: nop + IL_0070: ret +}"); + + var diff2 = compilation2.EmitDifference( + diff1.NextGeneration, + ImmutableArray.Create( + new SemanticEdit(SemanticEditKind.Update, f1, f2, GetSyntaxMapFromMarkers(source1, source2), preserveLocalVariables: true))); + diff2.VerifyIL("C.F", +@"{ + // Code size 113 (0x71) + .maxstack 9 + IL_0000: nop + IL_0001: ldsfld ""System.Runtime.CompilerServices.CallSite<<>A{00000008}#2, object>> C.<>o__0#2.<>p__0"" + IL_0006: brfalse.s IL_000a + IL_0008: br.s IL_0053 + IL_000a: ldc.i4 0x100 + IL_000f: ldstr ""F"" + IL_0014: ldnull + IL_0015: ldtoken ""C"" + IL_001a: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" + IL_001f: ldc.i4.3 + IL_0020: newarr ""Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo"" + IL_0025: dup + IL_0026: ldc.i4.0 + IL_0027: ldc.i4.0 + IL_0028: ldnull + IL_0029: call ""Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create(Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfoFlags, string)"" + IL_002e: stelem.ref + IL_002f: dup + IL_0030: ldc.i4.1 + IL_0031: ldc.i4.1 + IL_0032: ldnull + IL_0033: call ""Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create(Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfoFlags, string)"" + IL_0038: stelem.ref + IL_0039: dup + IL_003a: ldc.i4.2 + IL_003b: ldc.i4.s 17 + IL_003d: ldnull + IL_003e: call ""Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create(Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfoFlags, string)"" + IL_0043: stelem.ref + IL_0044: call ""System.Runtime.CompilerServices.CallSiteBinder Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags, string, System.Collections.Generic.IEnumerable, System.Type, System.Collections.Generic.IEnumerable)"" + IL_0049: call ""System.Runtime.CompilerServices.CallSite<<>A{00000008}#2, object>> System.Runtime.CompilerServices.CallSite<<>A{00000008}#2, object>>.Create(System.Runtime.CompilerServices.CallSiteBinder)"" + IL_004e: stsfld ""System.Runtime.CompilerServices.CallSite<<>A{00000008}#2, object>> C.<>o__0#2.<>p__0"" + IL_0053: ldsfld ""System.Runtime.CompilerServices.CallSite<<>A{00000008}#2, object>> C.<>o__0#2.<>p__0"" + IL_0058: ldfld ""<>A{00000008}#2, object> System.Runtime.CompilerServices.CallSite<<>A{00000008}#2, object>>.Target"" + IL_005d: ldsfld ""System.Runtime.CompilerServices.CallSite<<>A{00000008}#2, object>> C.<>o__0#2.<>p__0"" + IL_0062: ldarg.0 + IL_0063: ldarg.2 + IL_0064: newobj ""<>f__AnonymousType1..ctor(object)"" + IL_0069: ldarg.1 + IL_006a: callvirt ""void <>A{00000008}#2, object>.Invoke(System.Runtime.CompilerServices.CallSite, dynamic, , ref object)"" + IL_006f: nop + IL_0070: ret +}"); + } } } diff --git a/src/Compilers/VisualBasic/Portable/Symbols/AnonymousTypes/AnonymousTypeDescriptor.vb b/src/Compilers/VisualBasic/Portable/Symbols/AnonymousTypes/AnonymousTypeDescriptor.vb index 5707d028c91..529c4ba8297 100644 --- a/src/Compilers/VisualBasic/Portable/Symbols/AnonymousTypes/AnonymousTypeDescriptor.vb +++ b/src/Compilers/VisualBasic/Portable/Symbols/AnonymousTypes/AnonymousTypeDescriptor.vb @@ -15,8 +15,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols Friend Structure AnonymousTypeDescriptor Implements IEquatable(Of AnonymousTypeDescriptor) - Public Shared ReadOnly SubReturnParameterName As String = "Sub" - Public Shared ReadOnly FunctionReturnParameterName As String = "Function" + Public Const SubReturnParameterName As String = "Sub" + Public Const FunctionReturnParameterName As String = "Function" Friend Shared Function GetReturnParameterName(isFunction As Boolean) As String Return If(isFunction, FunctionReturnParameterName, SubReturnParameterName) -- GitLab