Repository navigation
Add the module name to generated PrivateImplementationDetails class #1257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
38aa68d
c742611
e5c6a6b
a25c713
087c5a1
130184d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3231,7 +3231,7 @@ public static void Main() | |
| } | ||
| } | ||
| "; | ||
| var compilation = CompileAndVerify(source, expectedOutput: "222333"); | ||
| var compilation = CompileAndVerify(source, options: TestOptions.ReleaseExe.WithModuleName("MODULE"), expectedOutput: "222333"); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @VladimirReshetnikov This was at your request.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we use a unicode escape sequence here vs. embedding unicode literals? It confuses Visual Studio less. |
||
|
|
||
| compilation.VerifyIL("D.Main", | ||
| @"{ | ||
|
|
@@ -3241,7 +3241,7 @@ .locals init (int[] V_0) //arr | |
| IL_0000: ldc.i4.4 | ||
| IL_0001: newarr ""int"" | ||
| IL_0006: dup | ||
| IL_0007: ldtoken ""<PrivateImplementationDetails>.__StaticArrayInitTypeSize=16 <PrivateImplementationDetails>.$$method0x6000001-42F1B77334EDFA917032CCF8353020C73F8C62E1"" | ||
| IL_0007: ldtoken ""<PrivateImplementationDetails><MODULE>.__StaticArrayInitTypeSize=16 <PrivateImplementationDetails><MODULE>.42F1B77334EDFA917032CCF8353020C73F8C62E1"" | ||
| IL_000c: call ""void System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array, System.RuntimeFieldHandle)"" | ||
| IL_0011: stloc.0 | ||
| IL_0012: ldloc.0 | ||
|
|
@@ -3560,7 +3560,7 @@ static void Main() | |
| "); | ||
|
|
||
| #region IL | ||
| // Can NOT compare IL because the Guid is different every time - <PrivateImplementationDetails>{a6c2d596-042b-4294-99ab-d34a2758ec15} | ||
| // Can NOT compare IL because the Guid is different every time - <PrivateImplementationDetails><MODULE>{a6c2d596-042b-4294-99ab-d34a2758ec15} | ||
| #if false | ||
| compilation.VerifyIL("MyArray.Main", | ||
| @"{ | ||
|
|
@@ -3594,7 +3594,7 @@ .locals init (sbyte[] V_0, //a1 | |
| IL_0028: ldc.i4.3 | ||
| IL_0029: newarr ""byte"" | ||
| IL_002e: dup | ||
| IL_002f: ldtoken ""<PrivateImplementationDetails>{a6c2d596-042b-4294-99ab-d34a2758ec15}.__StaticArrayInitTypeSize=3 <PrivateImplementationDetails>{a6c2d596-042b-4294-99ab-d34a2758ec15}.$$method0x6000001-0"" | ||
| IL_002f: ldtoken ""<PrivateImplementationDetails><MODULE>{a6c2d596-042b-4294-99ab-d34a2758ec15}.__StaticArrayInitTypeSize=3 <PrivateImplementationDetails><MODULE>{a6c2d596-042b-4294-99ab-d34a2758ec15}.0"" | ||
| IL_0034: call ""void System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array, System.RuntimeFieldHandle)"" | ||
| IL_0039: ldc.i4.0 | ||
| IL_003a: ldelem.u1 | ||
|
|
@@ -3620,7 +3620,7 @@ .locals init (sbyte[] V_0, //a1 | |
| IL_005f: ldc.i4.3 | ||
| IL_0060: newarr ""short"" | ||
| IL_0065: dup | ||
| IL_0066: ldtoken ""<PrivateImplementationDetails>{a6c2d596-042b-4294-99ab-d34a2758ec15}.__StaticArrayInitTypeSize=6 <PrivateImplementationDetails>{a6c2d596-042b-4294-99ab-d34a2758ec15}.$$method0x6000001-1"" | ||
| IL_0066: ldtoken ""<PrivateImplementationDetails><MODULE>{a6c2d596-042b-4294-99ab-d34a2758ec15}.__StaticArrayInitTypeSize=6 <PrivateImplementationDetails><MODULE>{a6c2d596-042b-4294-99ab-d34a2758ec15}.1"" | ||
| IL_006b: call ""void System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array, System.RuntimeFieldHandle)"" | ||
| IL_0070: stelem.ref | ||
| IL_0071: ldc.i4.1 | ||
|
|
@@ -6383,7 +6383,7 @@ public static void Main() | |
| System.Console.WriteLine(d[4]); | ||
| } | ||
| }"; | ||
| var compilation = CompileAndVerify(source, expectedOutput: @" | ||
| var compilation = CompileAndVerify(source, options: TestOptions.ReleaseExe.WithModuleName("MODULE"), expectedOutput: @" | ||
| 3 | ||
| -5 | ||
| True | ||
|
|
@@ -6406,7 +6406,7 @@ .maxstack 3 | |
| IL_0000: ldc.i4.5 | ||
| IL_0001: newarr ""int"" | ||
| IL_0006: dup | ||
| IL_0007: ldtoken ""<PrivateImplementationDetails>.__StaticArrayInitTypeSize=20 <PrivateImplementationDetails>.$$method0x6000001-56C14CB445C628421AC674599E302B0879FB496F"" | ||
| IL_0007: ldtoken ""<PrivateImplementationDetails><MODULE>.__StaticArrayInitTypeSize=20 <PrivateImplementationDetails><MODULE>.56C14CB445C628421AC674599E302B0879FB496F"" | ||
| IL_000c: call ""void System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array, System.RuntimeFieldHandle)"" | ||
| IL_0011: dup | ||
| IL_0012: ldc.i4.2 | ||
|
|
@@ -6418,7 +6418,7 @@ .maxstack 3 | |
| IL_0020: ldc.i4.5 | ||
| IL_0021: newarr ""bool"" | ||
| IL_0026: dup | ||
| IL_0027: ldtoken ""<PrivateImplementationDetails>.__StaticArrayInitTypeSize=5 <PrivateImplementationDetails>.$$method0x6000001-4E724558F6B816715597A51663AD8F05247E2C4A"" | ||
| IL_0027: ldtoken ""<PrivateImplementationDetails><MODULE>.__StaticArrayInitTypeSize=5 <PrivateImplementationDetails><MODULE>.4E724558F6B816715597A51663AD8F05247E2C4A"" | ||
| IL_002c: call ""void System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array, System.RuntimeFieldHandle)"" | ||
| IL_0031: dup | ||
| IL_0032: ldc.i4.2 | ||
|
|
@@ -6430,7 +6430,7 @@ .maxstack 3 | |
| IL_0040: ldc.i4.5 | ||
| IL_0041: newarr ""byte"" | ||
| IL_0046: dup | ||
| IL_0047: ldtoken ""<PrivateImplementationDetails>.__StaticArrayInitTypeSize=5 <PrivateImplementationDetails>.$$method0x6000001-9755240DD0C4C1AD226DEBD40C6D2EBD408250CB"" | ||
| IL_0047: ldtoken ""<PrivateImplementationDetails><MODULE>.__StaticArrayInitTypeSize=5 <PrivateImplementationDetails><MODULE>.9755240DD0C4C1AD226DEBD40C6D2EBD408250CB"" | ||
| IL_004c: call ""void System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array, System.RuntimeFieldHandle)"" | ||
| IL_0051: dup | ||
| IL_0052: ldc.i4.2 | ||
|
|
@@ -6442,7 +6442,7 @@ .maxstack 3 | |
| IL_0060: ldc.i4.5 | ||
| IL_0061: newarr ""char"" | ||
| IL_0066: dup | ||
| IL_0067: ldtoken ""<PrivateImplementationDetails>.__StaticArrayInitTypeSize=10 <PrivateImplementationDetails>.$$method0x6000001-E313A2813013780396D58750DC5D62221C86F42F"" | ||
| IL_0067: ldtoken ""<PrivateImplementationDetails><MODULE>.__StaticArrayInitTypeSize=10 <PrivateImplementationDetails><MODULE>.E313A2813013780396D58750DC5D62221C86F42F"" | ||
| IL_006c: call ""void System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array, System.RuntimeFieldHandle)"" | ||
| IL_0071: dup | ||
| IL_0072: ldc.i4.2 | ||
|
|
@@ -6454,7 +6454,7 @@ .maxstack 3 | |
| IL_0080: ldc.i4.5 | ||
| IL_0081: newarr ""float"" | ||
| IL_0086: dup | ||
| IL_0087: ldtoken ""<PrivateImplementationDetails>.__StaticArrayInitTypeSize=20 <PrivateImplementationDetails>.$$method0x6000001-2F3DD953DBFB23217E7CE0E76630EBD31267E237"" | ||
| IL_0087: ldtoken ""<PrivateImplementationDetails><MODULE>.__StaticArrayInitTypeSize=20 <PrivateImplementationDetails><MODULE>.2F3DD953DBFB23217E7CE0E76630EBD31267E237"" | ||
| IL_008c: call ""void System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array, System.RuntimeFieldHandle)"" | ||
| IL_0091: dup | ||
| IL_0092: ldc.i4.2 | ||
|
|
@@ -6466,7 +6466,7 @@ .maxstack 3 | |
| IL_00a0: ldc.i4.5 | ||
| IL_00a1: newarr ""double"" | ||
| IL_00a6: dup | ||
| IL_00a7: ldtoken ""<PrivateImplementationDetails>.__StaticArrayInitTypeSize=40 <PrivateImplementationDetails>.$$method0x6000001-11F3436B917FFBA0FAB0FAD5563AF18FA24AC16A"" | ||
| IL_00a7: ldtoken ""<PrivateImplementationDetails><MODULE>.__StaticArrayInitTypeSize=40 <PrivateImplementationDetails><MODULE>.11F3436B917FFBA0FAB0FAD5563AF18FA24AC16A"" | ||
| IL_00ac: call ""void System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array, System.RuntimeFieldHandle)"" | ||
| IL_00b1: dup | ||
| IL_00b2: ldc.i4.2 | ||
|
|
@@ -6499,8 +6499,8 @@ public static void Main() | |
| } | ||
| } | ||
| "; | ||
| var compilation = CompileAndVerify(source, expectedOutput: @"3-5"); | ||
| //string pid = "<PrivateImplementationDetails>" + compilation.Compilation.SourceModule.Pers | ||
| var compilation = CompileAndVerify(source, options: TestOptions.ReleaseExe.WithModuleName("MODULE"), expectedOutput: @"3-5"); | ||
| //string pid = "<PrivateImplementationDetails><MODULE>" + compilation.Compilation.SourceModule.Pers | ||
| compilation.VerifyIL("D.Main", | ||
| @"{ | ||
| // Code size 73 (0x49) | ||
|
|
@@ -6509,7 +6509,7 @@ .locals init (int[] V_0) //x | |
| IL_0000: ldc.i4.5 | ||
| IL_0001: newarr ""int"" | ||
| IL_0006: dup | ||
| IL_0007: ldtoken ""<PrivateImplementationDetails>.__StaticArrayInitTypeSize=20 <PrivateImplementationDetails>.$$method0x6000001-FF942E5F620FC460CF9424D564C73AD8A99C74EE"" | ||
| IL_0007: ldtoken ""<PrivateImplementationDetails><MODULE>.__StaticArrayInitTypeSize=20 <PrivateImplementationDetails><MODULE>.FF942E5F620FC460CF9424D564C73AD8A99C74EE"" | ||
| IL_000c: call ""void System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array, System.RuntimeFieldHandle)"" | ||
| IL_0011: dup | ||
| IL_0012: ldc.i4.2 | ||
|
|
@@ -6524,7 +6524,7 @@ .locals init (int[] V_0) //x | |
| IL_0027: ldc.i4.5 | ||
| IL_0028: newarr ""int"" | ||
| IL_002d: dup | ||
| IL_002e: ldtoken ""<PrivateImplementationDetails>.__StaticArrayInitTypeSize=20 <PrivateImplementationDetails>.$$method0x6000001-89E37886EEEDC70AEF61138E037CC60EFC35535F"" | ||
| IL_002e: ldtoken ""<PrivateImplementationDetails><MODULE>.__StaticArrayInitTypeSize=20 <PrivateImplementationDetails><MODULE>.89E37886EEEDC70AEF61138E037CC60EFC35535F"" | ||
| IL_0033: call ""void System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array, System.RuntimeFieldHandle)"" | ||
| IL_0038: dup | ||
| IL_0039: ldc.i4.4 | ||
|
|
@@ -6561,8 +6561,8 @@ public static void Main() | |
| } | ||
| } | ||
| "; | ||
| var compilation = CompileAndVerify(source, expectedOutput: @"30"); | ||
| //string pid = "<PrivateImplementationDetails>" + compilation.Compilation.SourceModule.Pers | ||
| var compilation = CompileAndVerify(source, options: TestOptions.ReleaseExe.WithModuleName("MODULE"), expectedOutput: @"30"); | ||
| //string pid = "<PrivateImplementationDetails><MODULE>" + compilation.Compilation.SourceModule.Pers | ||
| compilation.VerifyIL("D.Main", | ||
| @"{ | ||
| // Code size 82 (0x52) | ||
|
|
@@ -6592,7 +6592,7 @@ .locals init (int[] V_0) //x | |
| IL_002e: ldc.i4.s 15 | ||
| IL_0030: newarr ""int"" | ||
| IL_0035: dup | ||
| IL_0036: ldtoken ""<PrivateImplementationDetails>.__StaticArrayInitTypeSize=60 <PrivateImplementationDetails>.$$method0x6000001-49608711F905702F9F227AA782F8B408777D5DF9"" | ||
| IL_0036: ldtoken ""<PrivateImplementationDetails><MODULE>.__StaticArrayInitTypeSize=60 <PrivateImplementationDetails><MODULE>.49608711F905702F9F227AA782F8B408777D5DF9"" | ||
| IL_003b: call ""void System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array, System.RuntimeFieldHandle)"" | ||
| IL_0040: dup | ||
| IL_0041: ldc.i4.s 12 | ||
|
|
@@ -6716,7 +6716,7 @@ public static void Main() | |
| DBNull | ||
| "; | ||
|
|
||
| var compilation = CreateCompilationWithMscorlib45(source: source, options: TestOptions.ReleaseExe); | ||
| var compilation = CreateCompilationWithMscorlib45(source: source, options: TestOptions.ReleaseExe.WithModuleName("MODULE")); | ||
| var verifier = CompileAndVerify(compilation, expectedOutput: expectedOutput); | ||
|
|
||
| //NOTE: | ||
|
|
@@ -6728,7 +6728,7 @@ .maxstack 3 | |
| IL_0000: ldc.i4.5 | ||
| IL_0001: newarr ""System.TypeCode"" | ||
| IL_0006: dup | ||
| IL_0007: ldtoken ""<PrivateImplementationDetails>.__StaticArrayInitTypeSize=20 <PrivateImplementationDetails>.$$method0x6000001-3191FF614021ADF3122AC274EA5B6097C21BEB81"" | ||
| IL_0007: ldtoken ""<PrivateImplementationDetails><MODULE>.__StaticArrayInitTypeSize=20 <PrivateImplementationDetails><MODULE>.3191FF614021ADF3122AC274EA5B6097C21BEB81"" | ||
| IL_000c: call ""void System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array, System.RuntimeFieldHandle)"" | ||
| IL_0011: dup | ||
| IL_0012: ldc.i4.1 | ||
|
|
@@ -7240,7 +7240,7 @@ static void Main() | |
| } | ||
| } | ||
| "; | ||
| var compilation = CompileAndVerify(source, expectedOutput: @" | ||
| var compilation = CompileAndVerify(source, options: TestOptions.ReleaseExe.WithModuleName("MODULE"), expectedOutput: @" | ||
| F1=3, F2=33 | ||
| 444 | ||
| 127 | ||
|
|
@@ -7301,7 +7301,7 @@ .locals init (Program.C V_0, //obj | |
| IL_0085: ldc.i4.4 | ||
| IL_0086: newarr ""ushort"" | ||
| IL_008b: dup | ||
| IL_008c: ldtoken ""long <PrivateImplementationDetails>.$$method0x6000001-E9E8A66A117598333ABACF5B65971C2366E19B6C"" | ||
| IL_008c: ldtoken ""long <PrivateImplementationDetails><MODULE>.E9E8A66A117598333ABACF5B65971C2366E19B6C"" | ||
| IL_0091: call ""void System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array, System.RuntimeFieldHandle)"" | ||
| IL_0096: callvirt ""uint Program.C.Foo(out short, params ushort[])"" | ||
| IL_009b: call ""void System.Console.WriteLine(uint)"" | ||
|
|
@@ -7523,7 +7523,7 @@ public static void Main() | |
| } | ||
|
|
||
| "; | ||
| var compilation = CompileAndVerify(source, options: TestOptions.DebugExe); | ||
| var compilation = CompileAndVerify(source, options: TestOptions.DebugExe.WithModuleName("MODULE")); | ||
|
|
||
| compilation.VerifyIL("A.Main", | ||
| @"{ | ||
|
|
@@ -7534,7 +7534,7 @@ .locals init (int[] V_0) //arr | |
| IL_0001: ldc.i4.5 | ||
| IL_0002: newarr ""int"" | ||
| IL_0007: dup | ||
| IL_0008: ldtoken ""<PrivateImplementationDetails>.__StaticArrayInitTypeSize=20 <PrivateImplementationDetails>.$$method0x6000001-1036C5F8EF306104BD582D73E555F4DAE8EECB24"" | ||
| IL_0008: ldtoken ""<PrivateImplementationDetails><MODULE>.__StaticArrayInitTypeSize=20 <PrivateImplementationDetails><MODULE>.1036C5F8EF306104BD582D73E555F4DAE8EECB24"" | ||
| IL_000d: call ""void System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array, System.RuntimeFieldHandle)"" | ||
| IL_0012: stloc.0 | ||
| IL_0013: ret | ||
|
|
@@ -13006,7 +13006,7 @@ static void Run() | |
| } | ||
| } | ||
| "; | ||
| var compilation = CompileAndVerify(source, expectedOutput: @"False | ||
| var compilation = CompileAndVerify(source, options: TestOptions.ReleaseExe.WithModuleName("MODULE"), expectedOutput: @"False | ||
|
|
||
| True | ||
| System.Exception: Exception of type 'System.Exception' was thrown. | ||
|
|
@@ -13047,7 +13047,7 @@ .maxstack 4 | |
| IL_0040: ldc.i4.4 | ||
| IL_0041: newarr ""bool"" | ||
| IL_0046: dup | ||
| IL_0047: ldtoken ""int <PrivateImplementationDetails>.$$method0x6000001-35CCB1599F52363510686EF38B7DB5E7998DB108"" | ||
| IL_0047: ldtoken ""int <PrivateImplementationDetails><MODULE>.35CCB1599F52363510686EF38B7DB5E7998DB108"" | ||
| IL_004c: call ""void System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array, System.RuntimeFieldHandle)"" | ||
| IL_0051: ldc.i4.2 | ||
| IL_0052: ldelem.u1 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed some unused type parameters