82 references to ERR_ScopedMismatchInParameterOfTarget
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Conversions.cs (1)
2772
ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
:
Errors\ErrorFacts.cs (1)
2240
or ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (11)
RefStructInterfacesTests.cs (2)
22771
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "C1.Test1").WithArguments("x", "DTest1<T>").WithLocation(6, 25),
22774
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "C1.Test2").WithArguments("y", "DTest2").WithLocation(7, 22)
Semantics\ParamsCollectionTests.cs (9)
9794
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "Test1").WithArguments("a", "C1.Test1").WithLocation(15, 23),
9797
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "Test2").WithArguments("a", "C1.Test2").WithLocation(16, 23),
9800
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "Test3").WithArguments("a", "C1.Test3").WithLocation(17, 23)
9846
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "Test1").WithArguments("a", "C1.Test1").WithLocation(16, 23),
9849
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "Test2").WithArguments("a", "C1.Test2").WithLocation(17, 23),
9852
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "Test3").WithArguments("a", "C1.Test3").WithLocation(18, 23),
9907
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "Test1").WithArguments("a", "C1.Test1").WithLocation(16, 23),
9910
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "Test2").WithArguments("a", "C1.Test2").WithLocation(17, 23),
9913
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "Test3").WithArguments("a", "C1.Test3").WithLocation(18, 23)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (69)
Semantics\RefEscapingTests.cs (1)
15133
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "C.M").WithArguments("r", "D").WithLocation(3, 7));
Semantics\RefFieldTests.cs (67)
11428
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "r2 => r2").WithArguments("r2", "D2").WithLocation(9, 17));
15856
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(R x, R y) => x").WithArguments("y", "D2").WithLocation(11, 17),
15859
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref R x, ref R y) => ref x").WithArguments("y", "D5").WithLocation(13, 17),
15862
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D2)((R x, R y) => x)").WithArguments("y", "D2").WithLocation(18, 18),
15865
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D5)((ref R x, ref R y) => ref x)").WithArguments("y", "D5").WithLocation(20, 18),
15868
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(R x, R y) => x").WithArguments("y", "D2").WithLocation(25, 25),
15871
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref R x, ref R y) => ref x").WithArguments("y", "D5").WithLocation(27, 25));
15915
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "M1").WithArguments("y", "D2").WithLocation(15, 17),
15918
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "M3").WithArguments("y", "D5").WithLocation(17, 17),
15921
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D2)M1").WithArguments("y", "D2").WithLocation(22, 18),
15924
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D5)M3").WithArguments("y", "D5").WithLocation(24, 18),
15927
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "M1").WithArguments("y", "D2").WithLocation(29, 25),
15930
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "M3").WithArguments("y", "D5").WithLocation(31, 25));
15963
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref int x, ref int y) => ref x").WithArguments("x", "D2").WithLocation(10, 24),
15966
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref int x, ref int y) => ref x").WithArguments("x", "D2").WithLocation(15, 30),
15969
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref int x, ref int y) => ref x").WithArguments("x", "D2").WithLocation(20, 32));
16004
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "M1").WithArguments("x", "D2").WithLocation(12, 24),
16056
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "delegate(R x, R y) { return x; }").WithArguments("y", "D2").WithLocation(11, 17),
16059
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "delegate(ref R x, ref R y) { return ref x; }").WithArguments("y", "D5").WithLocation(13, 17),
16062
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D2)(delegate(R x, R y) { return x; })").WithArguments("y", "D2").WithLocation(18, 18),
16065
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D5)(delegate(ref R x, ref R y) { return ref x; })").WithArguments("y", "D5").WithLocation(20, 18),
16068
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "delegate(R x, R y) { return x; }").WithArguments("y", "D2").WithLocation(25, 25),
16071
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "delegate(ref R x, ref R y) { return ref x; }").WithArguments("y", "D5").WithLocation(27, 25));
16114
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(R x, R y) => x").WithArguments("y", "System.Linq.Expressions.Expression<D2>").WithLocation(12, 29),
16135
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref int x, ref int y) => ref x").WithArguments("y", "System.Linq.Expressions.Expression<D4>").WithLocation(14, 29),
16156
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(Expression<D2>)((R x, R y) => x)").WithArguments("y", "System.Linq.Expressions.Expression<D2>").WithLocation(19, 18),
16177
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(Expression<D4>)((ref int x, ref int y) => ref x)").WithArguments("y", "System.Linq.Expressions.Expression<D4>").WithLocation(21, 18),
16236
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref R<int> r) => ref F()").WithArguments("r", "D1<int>").WithLocation(13, 22),
16239
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(in R<int> r) => ref F()").WithArguments("r", "D3<int>").WithLocation(15, 22),
16242
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "([UnscopedRef] out R<int> r) => { r = default; return ref F(); }").WithArguments("r", "D5<int>").WithLocation(17, 22),
16245
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D1<int>)((ref R<int> r) => ref F())").WithArguments("r", "D1<int>").WithLocation(22, 18),
16248
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D3<int>)((in R<int> r) => ref F())").WithArguments("r", "D3<int>").WithLocation(24, 18),
16251
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D5<int>)(([UnscopedRef] out R<int> r) => { r = default; return ref F(); })").WithArguments("r", "D5<int>").WithLocation(26, 18),
16254
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref R<int> r) => ref F()").WithArguments("r", "D1<int>").WithLocation(31, 30),
16257
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(in R<int> r) => ref F()").WithArguments("r", "D3<int>").WithLocation(33, 30),
16260
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "([UnscopedRef] out R<int> r) => { r = default; return ref F(); }").WithArguments("r", "D5<int>").WithLocation(35, 30));
16291
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, $"({refModifier} int i) => ref F()").WithArguments("i", "D2<int>").WithLocation(14, 22),
16294
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, $"({refModifier} int i) => ref F()").WithArguments("i", "D3<int>").WithLocation(15, 22),
16297
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, $"({refModifier} int i) => new R<int>()").WithArguments("i", "D4<int>").WithLocation(16, 22));
16326
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, $"({refModifier} int i, ref R<int> r) => {{ }}").WithArguments("i", "D1<int>").WithLocation(12, 22),
16329
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, $"({refModifier} int i, out R<int> r) => {{ r = default; }}").WithArguments("i", "D3<int>").WithLocation(14, 22));
16362
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref int i) => new R<int>()").WithArguments("i", "D2<int>").WithLocation(16, 22),
16365
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(in int i) => new R<int>()").WithArguments("i", "D3<int>").WithLocation(17, 22),
16368
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "([UnscopedRef] out int i) => { i = 0; return new R<int>(); }").WithArguments("i", "D4B<int>").WithLocation(19, 24),
16371
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(R<int> r) => new R<int>()").WithArguments("r", "D5<int>").WithLocation(20, 22));
16405
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref int i) => ref F()").WithArguments("i", "D2<int>").WithLocation(16, 22),
16408
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(in int i) => ref F()").WithArguments("i", "D3<int>").WithLocation(17, 22),
16411
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "([UnscopedRef] out int i) => { i = 0; return ref F(); }").WithArguments("i", "D4<int>").WithLocation(18, 22),
16414
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(R<int> r) => ref F()").WithArguments("r", "D5<int>").WithLocation(19, 22));
16529
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "r => r").WithArguments("r", "D1").WithLocation(12, 17),
16613
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "delegate { }").WithArguments("<p0>", "D1").WithLocation(12, 17),
16616
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "delegate { }").WithArguments("<p1>", "D1").WithLocation(12, 17)
16752
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(r2, t2) => r2").WithArguments("r2", "D<U>").WithLocation(16, 25));
16847
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "r1 => r1").WithArguments("r1", "D1").WithLocation(10, 17),
17855
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(R x) => x").WithArguments("x", "D1").WithLocation(22, 19));
24410
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "([UnscopedRef] out int i2) => { i2 = 2; return ref F<int>(); }").WithArguments("i2", "D1<int>").WithLocation(10, 14));
24446
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "([UnscopedRef] ref int i2) => ref F<int>()").WithArguments("i2", "D1<int>").WithLocation(10, 14));
24483
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref R<int> r2) => ref F<int>()").WithArguments("r2", "D1<int>").WithLocation(11, 14));
25698
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F3").WithArguments("o", "D3<object>").WithLocation(12, 25));
25765
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F3").WithArguments("r", "D3<object>").WithLocation(11, 25));
25874
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F1").WithArguments("o", "D2<object>").WithLocation(18, 25),
25877
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F2").WithArguments("o", "D3<object>").WithLocation(19, 25),
25880
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F3").WithArguments("o", "D4<object>").WithLocation(20, 25));
29537
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F2").WithArguments("y", "<anonymous delegate>").WithLocation(12, 14),
29540
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F3").WithArguments("x", "<anonymous delegate>").WithLocation(13, 14),
29543
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F3").WithArguments("y", "<anonymous delegate>").WithLocation(13, 14),
29546
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F3").WithArguments("x", "<anonymous delegate>").WithLocation(15, 14));
Semantics\SimpleLambdaParametersWithModifiersTests.cs (1)
282
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(a, ref b) => { }").WithArguments("a", "D").WithLocation(8, 15));