82 references to ERR_ScopedMismatchInParameterOfTarget
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Conversions.cs (1)
2304
ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
:
Errors\ErrorFacts.cs (1)
2239
or ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (11)
RefStructInterfacesTests.cs (2)
22375
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "C1.Test1").WithArguments("x", "DTest1<T>").WithLocation(6, 25),
22378
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "C1.Test2").WithArguments("y", "DTest2").WithLocation(7, 22)
Semantics\ParamsCollectionTests.cs (9)
9810
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "Test1").WithArguments("a", "C1.Test1").WithLocation(15, 23),
9813
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "Test2").WithArguments("a", "C1.Test2").WithLocation(16, 23),
9816
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "Test3").WithArguments("a", "C1.Test3").WithLocation(17, 23)
9862
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "Test1").WithArguments("a", "C1.Test1").WithLocation(16, 23),
9865
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "Test2").WithArguments("a", "C1.Test2").WithLocation(17, 23),
9868
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "Test3").WithArguments("a", "C1.Test3").WithLocation(18, 23),
9923
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "Test1").WithArguments("a", "C1.Test1").WithLocation(16, 23),
9926
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "Test2").WithArguments("a", "C1.Test2").WithLocation(17, 23),
9929
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "Test3").WithArguments("a", "C1.Test3").WithLocation(18, 23)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (69)
Semantics\RefEscapingTests.cs (1)
11251
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "C.M").WithArguments("r", "D").WithLocation(3, 7));
Semantics\RefFieldTests.cs (67)
11452
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "r2 => r2").WithArguments("r2", "D2").WithLocation(9, 17));
15893
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(R x, R y) => x").WithArguments("y", "D2").WithLocation(11, 17),
15896
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref R x, ref R y) => ref x").WithArguments("y", "D5").WithLocation(13, 17),
15899
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D2)((R x, R y) => x)").WithArguments("y", "D2").WithLocation(18, 18),
15902
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D5)((ref R x, ref R y) => ref x)").WithArguments("y", "D5").WithLocation(20, 18),
15905
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(R x, R y) => x").WithArguments("y", "D2").WithLocation(25, 25),
15908
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref R x, ref R y) => ref x").WithArguments("y", "D5").WithLocation(27, 25));
15952
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "M1").WithArguments("y", "D2").WithLocation(15, 17),
15955
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "M3").WithArguments("y", "D5").WithLocation(17, 17),
15958
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D2)M1").WithArguments("y", "D2").WithLocation(22, 18),
15961
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D5)M3").WithArguments("y", "D5").WithLocation(24, 18),
15964
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "M1").WithArguments("y", "D2").WithLocation(29, 25),
15967
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "M3").WithArguments("y", "D5").WithLocation(31, 25));
16000
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref int x, ref int y) => ref x").WithArguments("x", "D2").WithLocation(10, 24),
16003
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref int x, ref int y) => ref x").WithArguments("x", "D2").WithLocation(15, 30),
16006
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref int x, ref int y) => ref x").WithArguments("x", "D2").WithLocation(20, 32));
16041
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "M1").WithArguments("x", "D2").WithLocation(12, 24),
16093
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "delegate(R x, R y) { return x; }").WithArguments("y", "D2").WithLocation(11, 17),
16096
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "delegate(ref R x, ref R y) { return ref x; }").WithArguments("y", "D5").WithLocation(13, 17),
16099
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D2)(delegate(R x, R y) { return x; })").WithArguments("y", "D2").WithLocation(18, 18),
16102
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D5)(delegate(ref R x, ref R y) { return ref x; })").WithArguments("y", "D5").WithLocation(20, 18),
16105
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "delegate(R x, R y) { return x; }").WithArguments("y", "D2").WithLocation(25, 25),
16108
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "delegate(ref R x, ref R y) { return ref x; }").WithArguments("y", "D5").WithLocation(27, 25));
16151
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(R x, R y) => x").WithArguments("y", "System.Linq.Expressions.Expression<D2>").WithLocation(12, 29),
16172
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref int x, ref int y) => ref x").WithArguments("y", "System.Linq.Expressions.Expression<D4>").WithLocation(14, 29),
16193
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(Expression<D2>)((R x, R y) => x)").WithArguments("y", "System.Linq.Expressions.Expression<D2>").WithLocation(19, 18),
16214
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(Expression<D4>)((ref int x, ref int y) => ref x)").WithArguments("y", "System.Linq.Expressions.Expression<D4>").WithLocation(21, 18),
16273
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref R<int> r) => ref F()").WithArguments("r", "D1<int>").WithLocation(13, 22),
16276
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(in R<int> r) => ref F()").WithArguments("r", "D3<int>").WithLocation(15, 22),
16279
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "([UnscopedRef] out R<int> r) => { r = default; return ref F(); }").WithArguments("r", "D5<int>").WithLocation(17, 22),
16282
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D1<int>)((ref R<int> r) => ref F())").WithArguments("r", "D1<int>").WithLocation(22, 18),
16285
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D3<int>)((in R<int> r) => ref F())").WithArguments("r", "D3<int>").WithLocation(24, 18),
16288
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D5<int>)(([UnscopedRef] out R<int> r) => { r = default; return ref F(); })").WithArguments("r", "D5<int>").WithLocation(26, 18),
16291
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref R<int> r) => ref F()").WithArguments("r", "D1<int>").WithLocation(31, 30),
16294
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(in R<int> r) => ref F()").WithArguments("r", "D3<int>").WithLocation(33, 30),
16297
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "([UnscopedRef] out R<int> r) => { r = default; return ref F(); }").WithArguments("r", "D5<int>").WithLocation(35, 30));
16328
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, $"({refModifier} int i) => ref F()").WithArguments("i", "D2<int>").WithLocation(14, 22),
16331
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, $"({refModifier} int i) => ref F()").WithArguments("i", "D3<int>").WithLocation(15, 22),
16334
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, $"({refModifier} int i) => new R<int>()").WithArguments("i", "D4<int>").WithLocation(16, 22));
16363
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, $"({refModifier} int i, ref R<int> r) => {{ }}").WithArguments("i", "D1<int>").WithLocation(12, 22),
16366
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, $"({refModifier} int i, out R<int> r) => {{ r = default; }}").WithArguments("i", "D3<int>").WithLocation(14, 22));
16399
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref int i) => new R<int>()").WithArguments("i", "D2<int>").WithLocation(16, 22),
16402
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(in int i) => new R<int>()").WithArguments("i", "D3<int>").WithLocation(17, 22),
16405
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "([UnscopedRef] out int i) => { i = 0; return new R<int>(); }").WithArguments("i", "D4B<int>").WithLocation(19, 24),
16408
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(R<int> r) => new R<int>()").WithArguments("r", "D5<int>").WithLocation(20, 22));
16442
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref int i) => ref F()").WithArguments("i", "D2<int>").WithLocation(16, 22),
16445
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(in int i) => ref F()").WithArguments("i", "D3<int>").WithLocation(17, 22),
16448
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "([UnscopedRef] out int i) => { i = 0; return ref F(); }").WithArguments("i", "D4<int>").WithLocation(18, 22),
16451
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(R<int> r) => ref F()").WithArguments("r", "D5<int>").WithLocation(19, 22));
16566
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "r => r").WithArguments("r", "D1").WithLocation(12, 17),
16650
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "delegate { }").WithArguments("<p0>", "D1").WithLocation(12, 17),
16653
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "delegate { }").WithArguments("<p1>", "D1").WithLocation(12, 17)
16789
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(r2, t2) => r2").WithArguments("r2", "D<U>").WithLocation(16, 25));
16884
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "r1 => r1").WithArguments("r1", "D1").WithLocation(10, 17),
17892
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(R x) => x").WithArguments("x", "D1").WithLocation(22, 19));
24504
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "([UnscopedRef] out int i2) => { i2 = 2; return ref F<int>(); }").WithArguments("i2", "D1<int>").WithLocation(10, 14));
24540
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "([UnscopedRef] ref int i2) => ref F<int>()").WithArguments("i2", "D1<int>").WithLocation(10, 14));
24577
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref R<int> r2) => ref F<int>()").WithArguments("r2", "D1<int>").WithLocation(11, 14));
25792
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F3").WithArguments("o", "D3<object>").WithLocation(12, 25));
25859
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F3").WithArguments("r", "D3<object>").WithLocation(11, 25));
25968
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F1").WithArguments("o", "D2<object>").WithLocation(18, 25),
25971
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F2").WithArguments("o", "D3<object>").WithLocation(19, 25),
25974
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F3").WithArguments("o", "D4<object>").WithLocation(20, 25));
29631
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F2").WithArguments("y", "<anonymous delegate>").WithLocation(12, 14),
29634
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F3").WithArguments("x", "<anonymous delegate>").WithLocation(13, 14),
29637
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F3").WithArguments("y", "<anonymous delegate>").WithLocation(13, 14),
29640
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));