52 references to ERR_PatternWrongType
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder_Patterns.cs (2)
614
diagnostics.Add(ErrorCode.
ERR_PatternWrongType
, expression.Syntax.Location, inputType, expression.Display);
777
Error(diagnostics, ErrorCode.
ERR_PatternWrongType
, typeSyntax, inputType, patternType);
Errors\ErrorFacts.cs (1)
1683
case ErrorCode.
ERR_PatternWrongType
:
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (34)
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)
6036
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "long").WithArguments("int?", "long").WithLocation(15, 18),
6185
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "object").WithArguments("System.TypedReference", "object").WithLocation(9, 23),
10575
Diagnostic(ErrorCode.
ERR_PatternWrongType
, @"""""").WithArguments("System.ReadOnlySpan<T>", "string").WithLocation(4, 56),
10578
Diagnostic(ErrorCode.
ERR_PatternWrongType
, @"""""").WithArguments("System.Span<T>", "string").WithLocation(5, 48));
10606
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "ReadOnlySpan<char>").WithArguments("System.ReadOnlySpan<T>", "System.ReadOnlySpan<char>").WithLocation(5, 56),
10609
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<char>").WithArguments("System.Span<T>", "System.Span<char>").WithLocation(6, 48));
10626
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "ReadOnlySpan<char>").WithArguments("System.ReadOnlySpan<T>", "System.ReadOnlySpan<char>").WithLocation(4, 56),
10629
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<char>").WithArguments("System.Span<T>", "System.Span<char>").WithLocation(5, 48));
10648
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "ReadOnlySpan<char>").WithArguments("object", "System.ReadOnlySpan<char>").WithLocation(4, 41),
10651
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<char>").WithArguments("object", "System.Span<char>").WithLocation(5, 41),
10654
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "ReadOnlySpan<char>").WithArguments("System.ValueType", "System.ReadOnlySpan<char>").WithLocation(6, 44),
10657
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<char>").WithArguments("System.ValueType", "System.Span<char>").WithLocation(7, 44));
10676
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "ReadOnlySpan<char>").WithArguments("object", "System.ReadOnlySpan<char>").WithLocation(4, 41),
10679
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<char>").WithArguments("object", "System.Span<char>").WithLocation(5, 41),
10682
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "ReadOnlySpan<char>").WithArguments("System.ValueType", "System.ReadOnlySpan<char>").WithLocation(6, 44),
10685
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "Span<char>").WithArguments("System.ValueType", "System.Span<char>").WithLocation(7, 44));
12247
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "G<int>").WithArguments("G<T>", "G<int>").WithLocation(32, 13),
12250
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "G<object>").WithArguments("G<T>", "G<object>").WithLocation(33, 13)
Semantics\PatternMatchingTests2.cs (5)
788
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "int").WithArguments("System.ValueTuple<int>", "int").WithLocation(8, 19),
797
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "int").WithArguments("System.ValueTuple<int>", "int").WithLocation(10, 29));
1999
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "1").WithArguments("C<T>", "int").WithLocation(5, 21)
2673
Diagnostic(ErrorCode.
ERR_PatternWrongType
, "System.Delegate").WithArguments("string", "System.Delegate").WithLocation(5, 19),
2753
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)
351
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),