69 references to ERR_ScopedMismatchInParameterOfTarget
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Conversions.cs (1)
765
ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
:
Errors\ErrorFacts.cs (1)
2182
case ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
:
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (67)
Semantics\RefFieldTests.cs (67)
10936
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "r2 => r2").WithArguments("r2", "D2").WithLocation(9, 17));
15333
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(R x, R y) => x").WithArguments("y", "D2").WithLocation(11, 17),
15336
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref R x, ref R y) => ref x").WithArguments("y", "D5").WithLocation(13, 17),
15339
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D2)((R x, R y) => x)").WithArguments("y", "D2").WithLocation(18, 18),
15342
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D5)((ref R x, ref R y) => ref x)").WithArguments("y", "D5").WithLocation(20, 18),
15345
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(R x, R y) => x").WithArguments("y", "D2").WithLocation(25, 25),
15348
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref R x, ref R y) => ref x").WithArguments("y", "D5").WithLocation(27, 25));
15392
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "M1").WithArguments("y", "D2").WithLocation(15, 17),
15395
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "M3").WithArguments("y", "D5").WithLocation(17, 17),
15398
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D2)M1").WithArguments("y", "D2").WithLocation(22, 18),
15401
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D5)M3").WithArguments("y", "D5").WithLocation(24, 18),
15404
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "M1").WithArguments("y", "D2").WithLocation(29, 25),
15407
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "M3").WithArguments("y", "D5").WithLocation(31, 25));
15440
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref int x, ref int y) => ref x").WithArguments("x", "D2").WithLocation(10, 24),
15443
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref int x, ref int y) => ref x").WithArguments("x", "D2").WithLocation(15, 30),
15446
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref int x, ref int y) => ref x").WithArguments("x", "D2").WithLocation(20, 32));
15481
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "M1").WithArguments("x", "D2").WithLocation(12, 24),
15533
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "delegate(R x, R y) { return x; }").WithArguments("y", "D2").WithLocation(11, 17),
15536
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "delegate(ref R x, ref R y) { return ref x; }").WithArguments("y", "D5").WithLocation(13, 17),
15539
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D2)(delegate(R x, R y) { return x; })").WithArguments("y", "D2").WithLocation(18, 18),
15542
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D5)(delegate(ref R x, ref R y) { return ref x; })").WithArguments("y", "D5").WithLocation(20, 18),
15545
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "delegate(R x, R y) { return x; }").WithArguments("y", "D2").WithLocation(25, 25),
15548
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "delegate(ref R x, ref R y) { return ref x; }").WithArguments("y", "D5").WithLocation(27, 25));
15591
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(R x, R y) => x").WithArguments("y", "System.Linq.Expressions.Expression<D2>").WithLocation(12, 29),
15612
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref int x, ref int y) => ref x").WithArguments("y", "System.Linq.Expressions.Expression<D4>").WithLocation(14, 29),
15633
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(Expression<D2>)((R x, R y) => x)").WithArguments("y", "System.Linq.Expressions.Expression<D2>").WithLocation(19, 18),
15654
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(Expression<D4>)((ref int x, ref int y) => ref x)").WithArguments("y", "System.Linq.Expressions.Expression<D4>").WithLocation(21, 18),
15713
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref R<int> r) => ref F()").WithArguments("r", "D1<int>").WithLocation(13, 22),
15716
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(in R<int> r) => ref F()").WithArguments("r", "D3<int>").WithLocation(15, 22),
15719
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "([UnscopedRef] out R<int> r) => { r = default; return ref F(); }").WithArguments("r", "D5<int>").WithLocation(17, 22),
15722
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D1<int>)((ref R<int> r) => ref F())").WithArguments("r", "D1<int>").WithLocation(22, 18),
15725
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D3<int>)((in R<int> r) => ref F())").WithArguments("r", "D3<int>").WithLocation(24, 18),
15728
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(D5<int>)(([UnscopedRef] out R<int> r) => { r = default; return ref F(); })").WithArguments("r", "D5<int>").WithLocation(26, 18),
15731
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref R<int> r) => ref F()").WithArguments("r", "D1<int>").WithLocation(31, 30),
15734
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(in R<int> r) => ref F()").WithArguments("r", "D3<int>").WithLocation(33, 30),
15737
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "([UnscopedRef] out R<int> r) => { r = default; return ref F(); }").WithArguments("r", "D5<int>").WithLocation(35, 30));
15768
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, $"({refModifier} int i) => ref F()").WithArguments("i", "D2<int>").WithLocation(14, 22),
15771
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, $"({refModifier} int i) => ref F()").WithArguments("i", "D3<int>").WithLocation(15, 22),
15774
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, $"({refModifier} int i) => new R<int>()").WithArguments("i", "D4<int>").WithLocation(16, 22));
15803
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, $"({refModifier} int i, ref R<int> r) => {{ }}").WithArguments("i", "D1<int>").WithLocation(12, 22),
15806
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, $"({refModifier} int i, out R<int> r) => {{ r = default; }}").WithArguments("i", "D3<int>").WithLocation(14, 22));
15839
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref int i) => new R<int>()").WithArguments("i", "D2<int>").WithLocation(16, 22),
15842
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(in int i) => new R<int>()").WithArguments("i", "D3<int>").WithLocation(17, 22),
15845
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "([UnscopedRef] out int i) => { i = 0; return new R<int>(); }").WithArguments("i", "D4B<int>").WithLocation(19, 24),
15848
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(R<int> r) => new R<int>()").WithArguments("r", "D5<int>").WithLocation(20, 22));
15882
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref int i) => ref F()").WithArguments("i", "D2<int>").WithLocation(16, 22),
15885
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(in int i) => ref F()").WithArguments("i", "D3<int>").WithLocation(17, 22),
15888
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "([UnscopedRef] out int i) => { i = 0; return ref F(); }").WithArguments("i", "D4<int>").WithLocation(18, 22),
15891
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(R<int> r) => ref F()").WithArguments("r", "D5<int>").WithLocation(19, 22));
16006
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "r => r").WithArguments("r", "D1").WithLocation(12, 17),
16090
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "delegate { }").WithArguments("<p0>", "D1").WithLocation(12, 17),
16093
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "delegate { }").WithArguments("<p1>", "D1").WithLocation(12, 17)
16232
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(r2, t2) => r2").WithArguments("r2", "D<U>").WithLocation(16, 25));
16327
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "r1 => r1").WithArguments("r1", "D1").WithLocation(10, 17),
17277
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(R x) => x").WithArguments("x", "D1").WithLocation(22, 19));
23357
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "([UnscopedRef] out int i2) => { i2 = 2; return ref F<int>(); }").WithArguments("i2", "D1<int>").WithLocation(10, 14));
23393
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "([UnscopedRef] ref int i2) => ref F<int>()").WithArguments("i2", "D1<int>").WithLocation(10, 14));
23430
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "(ref R<int> r2) => ref F<int>()").WithArguments("r2", "D1<int>").WithLocation(11, 14));
24635
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F3").WithArguments("o", "D3<object>").WithLocation(12, 25));
24702
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F3").WithArguments("r", "D3<object>").WithLocation(11, 25));
24811
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F1").WithArguments("o", "D2<object>").WithLocation(18, 25),
24814
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F2").WithArguments("o", "D3<object>").WithLocation(19, 25),
24817
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F3").WithArguments("o", "D4<object>").WithLocation(20, 25));
28276
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F2").WithArguments("y", "<anonymous delegate>").WithLocation(12, 14),
28279
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F3").WithArguments("x", "<anonymous delegate>").WithLocation(13, 14),
28282
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F3").WithArguments("y", "<anonymous delegate>").WithLocation(13, 14),
28285
Diagnostic(ErrorCode.
ERR_ScopedMismatchInParameterOfTarget
, "F3").WithArguments("x", "<anonymous delegate>").WithLocation(15, 14));