72 references to ERR_PatternWrongType
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder_Patterns.cs (2)
624
diagnostics.Add(ErrorCode.
ERR_PatternWrongType
, expression.Syntax.Location, inputType, expression.Display);
787
Error(diagnostics, ErrorCode.
ERR_PatternWrongType
, typeSyntax, inputType, patternType);
Errors\ErrorFacts.cs (1)
1745
or ErrorCode.
ERR_PatternWrongType
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (54)
FirstClassSpanTests.cs (6)
1102
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<int>").WithArguments("int[]", "System.Span<int>").WithLocation(2, 14));
1121
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<int>").WithArguments("int[]", "System.Span<int>").WithLocation(4, 10));
1165
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<string>").WithArguments("object[]", "System.Span<string>").WithLocation(2, 14));
1184
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<string>").WithArguments("object[]", "System.Span<string>").WithLocation(4, 10));
1228
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "ReadOnlySpan<char>").WithArguments("string", "System.ReadOnlySpan<char>").WithLocation(2, 14));
1247
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "ReadOnlySpan<char>").WithArguments("string", "System.ReadOnlySpan<char>").WithLocation(4, 10));
RefStructInterfacesTests.cs (14)
24940
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "S").WithArguments("I1", "S").WithLocation(6, 19)
24982
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "I1").WithArguments("T", "I1").WithLocation(7, 19),
24985
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "I1").WithArguments("S", "I1").WithLocation(17, 19)
25192
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "U").WithArguments("T", "U").WithLocation(7, 19),
25195
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "U").WithArguments("S", "U").WithLocation(17, 19)
25239
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "U").WithArguments("T", "U").WithLocation(8, 19),
25242
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "U").WithArguments("S", "U").WithLocation(19, 19)
25390
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "S").WithArguments("U", "S").WithLocation(6, 19)
25422
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "S").WithArguments("U", "S").WithLocation(7, 19)
25453
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "S2").WithArguments("S1", "S2").WithLocation(6, 19)
25484
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "U").WithArguments("T", "U").WithLocation(8, 19),
25487
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "T").WithArguments("U", "T").WithLocation(14, 19)
25515
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "T").WithArguments("S", "T").WithLocation(7, 19)
25639
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "S").WithArguments("S1", "S").WithLocation(6, 19)
Semantics\PatternMatchingTests.cs (22)
222
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "long").WithArguments("string", "long").WithLocation(12, 18),
3122
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "string").WithArguments("long", "string").WithLocation(10, 33),
3125
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "int[]").WithArguments("int", "int[]").WithLocation(11, 32)
4754
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "string").WithArguments("int?", "string").WithLocation(13, 18)
6038
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "long").WithArguments("int?", "long").WithLocation(15, 18),
6187
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "object").WithArguments("System.TypedReference", "object").WithLocation(9, 23),
10579
Diagnostic(ErrorCode.
ERR_PatternWrongType
, @"""""").WithArguments("System.ReadOnlySpan<T>", "string").WithLocation(4, 56),
10582
Diagnostic(ErrorCode.
ERR_PatternWrongType
, @"""""").WithArguments("System.Span<T>", "string").WithLocation(5, 48));
10610
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "ReadOnlySpan<char>").WithArguments("System.ReadOnlySpan<T>", "System.ReadOnlySpan<char>").WithLocation(5, 56),
10613
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<char>").WithArguments("System.Span<T>", "System.Span<char>").WithLocation(6, 48));
10630
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "ReadOnlySpan<char>").WithArguments("System.ReadOnlySpan<T>", "System.ReadOnlySpan<char>").WithLocation(4, 56),
10633
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<char>").WithArguments("System.Span<T>", "System.Span<char>").WithLocation(5, 48));
10652
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "ReadOnlySpan<char>").WithArguments("object", "System.ReadOnlySpan<char>").WithLocation(4, 41),
10655
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<char>").WithArguments("object", "System.Span<char>").WithLocation(5, 41),
10658
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "ReadOnlySpan<char>").WithArguments("System.ValueType", "System.ReadOnlySpan<char>").WithLocation(6, 44),
10661
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<char>").WithArguments("System.ValueType", "System.Span<char>").WithLocation(7, 44));
10680
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "ReadOnlySpan<char>").WithArguments("object", "System.ReadOnlySpan<char>").WithLocation(4, 41),
10683
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<char>").WithArguments("object", "System.Span<char>").WithLocation(5, 41),
10686
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "ReadOnlySpan<char>").WithArguments("System.ValueType", "System.ReadOnlySpan<char>").WithLocation(6, 44),
10689
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<char>").WithArguments("System.ValueType", "System.Span<char>").WithLocation(7, 44));
12251
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "G<int>").WithArguments("G<T>", "G<int>").WithLocation(32, 13),
12254
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "G<object>").WithArguments("G<T>", "G<object>").WithLocation(33, 13)
Semantics\PatternMatchingTests2.cs (5)
784
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "int").WithArguments("System.ValueTuple<int>", "int").WithLocation(8, 19),
793
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "int").WithArguments("System.ValueTuple<int>", "int").WithLocation(10, 29));
1995
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "1").WithArguments("C<T>", "int").WithLocation(5, 21)
2669
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "System.Delegate").WithArguments("string", "System.Delegate").WithLocation(5, 19),
2736
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "System.Delegate").WithArguments("string", "System.Delegate").WithLocation(6, 22),
Semantics\PatternMatchingTests5.cs (6)
2045
Diagnostic(ErrorCode.
ERR_PatternWrongType
, @"""""").WithArguments("T", "string").WithLocation(13, 9)
2092
Diagnostic(ErrorCode.
ERR_PatternWrongType
, @"""""").WithArguments("T", "string").WithLocation(13, 9)
2142
Diagnostic(ErrorCode.
ERR_PatternWrongType
, @"""""").WithArguments("T", "string").WithLocation(13, 9)
2188
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "int").WithArguments("C", "int").WithLocation(9, 5),
2250
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "int").WithArguments("C", "int").WithLocation(9, 5),
2314
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "int").WithArguments("C", "int").WithLocation(9, 5),
Semantics\PatternSwitchTests.cs (1)
352
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "int").WithArguments("string", "int").WithLocation(8, 18)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
IOperation\IOperationTests_IIsPatternExpression.cs (1)
375
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "X").WithArguments("int?", "X").WithLocation(8, 28)
IOperation\IOperationTests_IPatternSwitchCase.cs (1)
551
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "X").WithArguments("int?", "X").WithLocation(9, 28)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (12)
Semantics\SpanStackSafetyTests.cs (12)
84
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<int>").WithArguments("object", "System.Span<int>").WithLocation(10, 18)
109
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<int>").WithArguments("T", "System.Span<int>").WithLocation(9, 18)
134
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<int>").WithArguments("T", "System.Span<int>").WithLocation(9, 18)
159
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<object>").WithArguments("System.Span<string>", "System.Span<object>").WithLocation(9, 18),
162
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "object").WithArguments("System.Span<string>", "object").WithLocation(11, 18)
185
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "T").WithArguments("System.Span<string>", "T").WithLocation(9, 18)
208
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "T").WithArguments("System.Span<string>", "T").WithLocation(9, 18)
248
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<int>").WithArguments("object", "System.Span<int>").WithLocation(9, 18));
272
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<int>").WithArguments("T", "System.Span<int>").WithLocation(9, 18));
294
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "object").WithArguments("System.Span<int>", "object").WithLocation(8, 18));
316
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "T").WithArguments("System.Span<int>", "T").WithLocation(8, 18));
338
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "T").WithArguments("System.Span<int>", "T").WithLocation(8, 18));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Parsing\PatternParsingTests.cs (1)
59
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "string").WithArguments("int", "string").WithLocation(11, 18),