Skip to content

Commit 0d914e3

Browse files
author
Julien Couvreur
committed
Resolve merge conflicts in extension tests
1 parent a8831c6 commit 0d914e3

File tree

3 files changed

+132
-77
lines changed

3 files changed

+132
-77
lines changed

src/Compilers/CSharp/Test/Emit/Emit/DynamicAnalysis/DynamicInstrumentationTests.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3705,12 +3705,12 @@ public void M()
37053705
""" + InstrumentationHelperSource;
37063706

37073707
var checker = new CSharpInstrumentationChecker();
3708-
checker.Method(3, 1, snippet: "", expectBodySpan: false)
3708+
checker.Method(4, 1, snippet: "", expectBodySpan: false)
37093709
.True("42.M();")
37103710
.True("Microsoft.CodeAnalysis.Runtime.Instrumentation.FlushPayload();");
3711-
checker.Method(5, 1, snippet: "public void M()")
3711+
checker.Method(6, 1, snippet: "public void M()")
37123712
.True("""System.Console.WriteLine("Test");""");
3713-
checker.Method(7, 1)
3713+
checker.Method(8, 1)
37143714
.True()
37153715
.False()
37163716
.True()
@@ -3801,13 +3801,13 @@ public int P
38013801
""" + InstrumentationHelperSource;
38023802

38033803
var checker = new CSharpInstrumentationChecker();
3804-
checker.Method(3, 1, snippet: "", expectBodySpan: false)
3804+
checker.Method(4, 1, snippet: "", expectBodySpan: false)
38053805
.True("_ = 42.P;")
38063806
.True("Microsoft.CodeAnalysis.Runtime.Instrumentation.FlushPayload();");
3807-
checker.Method(5, 1, snippet: "get")
3807+
checker.Method(6, 1, snippet: "get")
38083808
.True("""System.Console.WriteLine("Test");""")
38093809
.True("return 0;");
3810-
checker.Method(7, 1)
3810+
checker.Method(8, 1)
38113811
.True()
38123812
.False()
38133813
.True()
@@ -3862,14 +3862,14 @@ public void M()
38623862
""" + InstrumentationHelperSource;
38633863

38643864
var checker = new CSharpInstrumentationChecker();
3865-
checker.Method(3, 1, snippet: "", expectBodySpan: false)
3865+
checker.Method(4, 1, snippet: "", expectBodySpan: false)
38663866
.True("42.M();")
38673867
.True("Microsoft.CodeAnalysis.Runtime.Instrumentation.FlushPayload();");
3868-
checker.Method(5, 1, snippet: "public void M()")
3868+
checker.Method(6, 1, snippet: "public void M()")
38693869
.True("""System.Console.WriteLine("Test");""")
38703870
.True("var f = () =>")
38713871
.True("f();");
3872-
checker.Method(7, 1)
3872+
checker.Method(8, 1)
38733873
.True()
38743874
.False()
38753875
.True()
@@ -3924,13 +3924,13 @@ static void local()
39243924
""" + InstrumentationHelperSource;
39253925

39263926
var checker = new CSharpInstrumentationChecker();
3927-
checker.Method(3, 1, snippet: "", expectBodySpan: false)
3927+
checker.Method(4, 1, snippet: "", expectBodySpan: false)
39283928
.True("42.M();")
39293929
.True("Microsoft.CodeAnalysis.Runtime.Instrumentation.FlushPayload();");
3930-
checker.Method(5, 1, snippet: "public void M()")
3930+
checker.Method(6, 1, snippet: "public void M()")
39313931
.True("local();")
39323932
.True("""System.Console.WriteLine("Test");""");
3933-
checker.Method(8, 1)
3933+
checker.Method(9, 1)
39343934
.True()
39353935
.False()
39363936
.True()
@@ -4005,13 +4005,13 @@ void local()
40054005
var source = classic ? classicSource : newSource;
40064006

40074007
var checker = new CSharpInstrumentationChecker();
4008-
checker.Method(3, 1, snippet: "", expectBodySpan: false)
4008+
checker.Method(classic ? 3 : 4, 1, snippet: "", expectBodySpan: false)
40094009
.True("42.M();")
40104010
.True("Microsoft.CodeAnalysis.Runtime.Instrumentation.FlushPayload();");
4011-
checker.Method(5, 1, snippet: classic ? "public static void M(this int i)" : "public void M()")
4011+
checker.Method(classic ? 5 : 6, 1, snippet: classic ? "public static void M(this int i)" : "public void M()")
40124012
.True("local();")
40134013
.True("""System.Console.WriteLine(i);""");
4014-
checker.Method(8, 1)
4014+
checker.Method(classic ? 8 : 9, 1)
40154015
.True()
40164016
.False()
40174017
.True()

src/Compilers/CSharp/Test/Emit3/Semantics/ExtensionTests.cs

Lines changed: 58 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28691,7 +28691,7 @@ static class E
2869128691
IVariableInitializerOperation (OperationKind.VariableInitializer, Type: null) (Syntax: '= from x in ... () select x')
2869228692
ITranslatedQueryOperation (OperationKind.TranslatedQuery, Type: System.String) (Syntax: 'from x in n ... () select x')
2869328693
Expression:
28694-
IInvocationOperation ( System.String E.<>E__0.Select(System.Func<C, C> selector)) (OperationKind.Invocation, Type: System.String, IsImplicit) (Syntax: 'select x')
28694+
IInvocationOperation ( System.String E.<G>$9794DAFCCB9E752B29BFD6350ADA77F2.Select(System.Func<C, C> selector)) (OperationKind.Invocation, Type: System.String, IsImplicit) (Syntax: 'select x')
2869528695
Instance Receiver:
2869628696
IObjectCreationOperation (Constructor: C..ctor()) (OperationKind.ObjectCreation, Type: C) (Syntax: 'new C()')
2869728697
Arguments(0)
@@ -29287,7 +29287,7 @@ static class E
2928729287
var tree = comp.SyntaxTrees.Single();
2928829288
var model = comp.GetSemanticModel(tree);
2928929289
var memberAccess = GetSyntax<MemberAccessExpressionSyntax>(tree, "i.Property");
29290-
AssertEx.Equal("System.String E.<>E__0<System.String>.Property { get; }", model.GetSymbolInfo(memberAccess).Symbol.ToTestDisplayString());
29290+
AssertEx.Equal("System.String E.<G>$74EBC78B2187AB07A25EEFC1322000B0<System.String>.Property { get; }", model.GetSymbolInfo(memberAccess).Symbol.ToTestDisplayString());
2929129291
}
2929229292

2929329293
[Fact]
@@ -29588,7 +29588,7 @@ public static void Main(string[] args)
2958829588
var model = comp.GetSemanticModel(tree);
2958929589
var memberAccess = GetSyntax<MemberAccessExpressionSyntax>(tree, "a.Extension");
2959029590
Assert.Null(model.GetSymbolInfo(memberAccess).Symbol);
29591-
Assert.Equal(["System.String E.<>E__0.Extension()"], model.GetMemberGroup(memberAccess).ToTestDisplayStrings());
29591+
AssertEx.Equal(["System.String E.<G>$43BB1C51423008731091E2D86C21895C.Extension()"], model.GetMemberGroup(memberAccess).ToTestDisplayStrings());
2959229592

2959329593
memberAccess = GetSyntax<MemberAccessExpressionSyntax>(tree, "a.Extension2");
2959429594
Assert.Null(model.GetSymbolInfo(memberAccess).Symbol);
@@ -44740,7 +44740,7 @@ static class E
4474044740
public void RefAnalysis_Invocation_11()
4474144741
{
4474244742
// Based on this extension, but missing the implementation method:
44743-
// static class E
44743+
// public static class E
4474444744
// {
4474544745
// extension(ref int i)
4474644746
// {
@@ -44749,25 +44749,34 @@ public void RefAnalysis_Invocation_11()
4474944749
// }
4475044750
string ilSrc = """
4475144751
.class public auto ansi abstract sealed beforefieldinit E
44752-
extends [mscorlib]System.Object
44752+
extends System.Object
4475344753
{
4475444754
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 )
44755-
.class nested public auto ansi sealed specialname beforefieldinit '<>E__0'
44756-
extends [mscorlib]System.Object
44755+
.class nested public auto ansi sealed specialname '<G>$BA41CFE2B5EDAEB8C1B9062F59ED4D69'
44756+
extends System.Object
4475744757
{
44758-
.method private hidebysig specialname static void '<Extension>$' ( int32& i ) cil managed
44758+
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 )
44759+
.class nested public auto ansi abstract sealed specialname '<M>$56B5C634B2E52051C75D91F71BA8833A'
44760+
extends System.Object
4475944761
{
44760-
IL_0000: ret
44762+
.method public hidebysig specialname static void '<Extension>$' ( int32& i ) cil managed
44763+
{
44764+
ret
44765+
}
4476144766
}
44762-
4476344767
.method public hidebysig instance int32& M () cil managed
4476444768
{
44765-
IL_0000: ldnull
44766-
IL_0001: throw
44769+
.custom instance void System.Runtime.CompilerServices.ExtensionMarkerAttribute::.ctor(string) = (
44770+
01 00 24 3c 4d 3e 24 35 36 42 35 43 36 33 34 42
44771+
32 45 35 32 30 35 31 43 37 35 44 39 31 46 37 31
44772+
42 41 38 38 33 33 41 00 00
44773+
)
44774+
ldnull
44775+
throw
4476744776
}
4476844777
}
4476944778
}
44770-
""";
44779+
""" + ExtensionMarkerAttributeIL;
4477144780

4477244781
string source = """
4477344782
class C
@@ -44848,25 +44857,34 @@ public void RefAnalysis_Deconstruct_02()
4484844857
// }
4484944858
string ilSrc = """
4485044859
.class public auto ansi abstract sealed beforefieldinit E
44851-
extends [mscorlib]System.Object
44860+
extends System.Object
4485244861
{
4485344862
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 )
44854-
.class nested public auto ansi sealed specialname beforefieldinit '<>E__0'
44855-
extends [mscorlib]System.Object
44863+
.class nested public auto ansi sealed specialname '<G>$C43E2675C7BBF9284AF22FB8A9BF0280'
44864+
extends System.Object
4485644865
{
44857-
.method private hidebysig specialname static void '<Extension>$' ( object o ) cil managed
44866+
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 )
44867+
.class nested public auto ansi abstract sealed specialname '<M>$119AA281C143547563250CAF89B48A76'
44868+
extends System.Object
4485844869
{
44859-
IL_0000: ret
44870+
.method public hidebysig specialname static void '<Extension>$' ( object o ) cil managed
44871+
{
44872+
ret
44873+
}
4486044874
}
44861-
4486244875
.method public hidebysig instance void Deconstruct ( [out] int32& x1, [out] int32& x2 ) cil managed
4486344876
{
44864-
IL_0000: ldnull
44865-
IL_0001: throw
44877+
.custom instance void System.Runtime.CompilerServices.ExtensionMarkerAttribute::.ctor(string) = (
44878+
01 00 24 3c 4d 3e 24 31 31 39 41 41 32 38 31 43
44879+
31 34 33 35 34 37 35 36 33 32 35 30 43 41 46 38
44880+
39 42 34 38 41 37 36 00 00
44881+
)
44882+
ldnull
44883+
throw
4486644884
}
4486744885
}
4486844886
}
44869-
""";
44887+
""" + ExtensionMarkerAttributeIL;
4487044888

4487144889
var source = """
4487244890
object o = new object();
@@ -44920,25 +44938,34 @@ public void RefAnalysis_Foreach_01()
4492044938
string ilSrc = """
4492144939

4492244940
.class public auto ansi abstract sealed beforefieldinit E
44923-
extends [mscorlib]System.Object
44941+
extends System.Object
4492444942
{
4492544943
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 )
44926-
.class nested public auto ansi sealed specialname beforefieldinit '<>E__0'
44927-
extends [mscorlib]System.Object
44944+
.class nested public auto ansi sealed specialname '<G>$C43E2675C7BBF9284AF22FB8A9BF0280'
44945+
extends System.Object
4492844946
{
44929-
.method private hidebysig specialname static void '<Extension>$' ( object o ) cil managed
44947+
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 )
44948+
.class nested public auto ansi abstract sealed specialname '<M>$119AA281C143547563250CAF89B48A76'
44949+
extends System.Object
4493044950
{
44931-
IL_0000: ret
44951+
.method public hidebysig specialname static void '<Extension>$' ( object o ) cil managed
44952+
{
44953+
ret
44954+
}
4493244955
}
44933-
4493444956
.method public hidebysig instance class [mscorlib]System.Collections.Generic.IEnumerator`1<int32> GetEnumerator () cil managed
4493544957
{
44936-
IL_0000: ldnull
44937-
IL_0001: throw
44958+
.custom instance void System.Runtime.CompilerServices.ExtensionMarkerAttribute::.ctor(string) = (
44959+
01 00 24 3c 4d 3e 24 31 31 39 41 41 32 38 31 43
44960+
31 34 33 35 34 37 35 36 33 32 35 30 43 41 46 38
44961+
39 42 34 38 41 37 36 00 00
44962+
)
44963+
ldnull
44964+
throw
4493844965
}
4493944966
}
4494044967
}
44941-
""";
44968+
""" + ExtensionMarkerAttributeIL;
4494244969

4494344970
var source = """
4494444971
foreach (var x in new object()) { }

0 commit comments

Comments
 (0)