65 references to ERR_InvalidQM
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder_Expressions.cs (1)
320
if (op.NoCommonTypeError == ErrorCode.
ERR_InvalidQM
&& trueArg is Symbol trueSymbol && falseArg is Symbol falseSymbol)
Binder\Binder_Operators.cs (1)
5736
ErrorCode noCommonTypeError = hadMultipleCandidates ? ErrorCode.ERR_AmbigQM : ErrorCode.
ERR_InvalidQM
;
Errors\ErrorFacts.cs (1)
756
or ErrorCode.
ERR_InvalidQM
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (5)
Semantics\CollectionExpressionTests.cs (4)
600
Diagnostic(ErrorCode.
ERR_InvalidQM
, "i == 0 ? null : default").WithArguments("<null>", "default").WithLocation(14, 19));
3316
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? [new int[0]] : [[1, 2, 3]]").WithArguments("collection expression", "collection expression").WithLocation(6, 17));
3441
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? [x] : [y]").WithArguments("collection expression", "collection expression").WithLocation(9, 29));
9768
Diagnostic(ErrorCode.
ERR_InvalidQM
, "c ? [null] : []").WithArguments("collection expression", "collection expression").WithLocation(5, 26));
Semantics\ExtensionTests.cs (1)
15462
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? object.M : object.M").WithArguments("method group", "method group").WithLocation(2, 9));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (56)
Semantics\ConditionalOperatorTests.cs (13)
82
Diagnostic(ErrorCode.
ERR_InvalidQM
, "true ? GetUserGeneric<char>() : GetUserNonGeneric()").WithArguments("D<char>", "C"));
103
Diagnostic(ErrorCode.
ERR_InvalidQM
, "true ? GetInt() : null").WithArguments("int", "<null>"));
109
Diagnostic(ErrorCode.
ERR_InvalidQM
, "false ? GetString : (System.Func<int>)null").WithArguments("method group", "System.Func<int>"));
111
Diagnostic(ErrorCode.
ERR_InvalidQM
, "true ? (System.Func<int, short>)null : x => x").WithArguments("System.Func<int, short>", "lambda expression"));
118
Diagnostic(ErrorCode.
ERR_InvalidQM
, "true ? null : null").WithArguments("<null>", "<null>"));
120
Diagnostic(ErrorCode.
ERR_InvalidQM
, "false ? null : GetInt").WithArguments("<null>", "method group"));
122
Diagnostic(ErrorCode.
ERR_InvalidQM
, "true ? null : x => x").WithArguments("<null>", "lambda expression"));
125
Diagnostic(ErrorCode.
ERR_InvalidQM
, "false ? GetInt : GetInt").WithArguments("method group", "method group"));
127
Diagnostic(ErrorCode.
ERR_InvalidQM
, "true ? GetInt : x => x").WithArguments("method group", "lambda expression"));
130
Diagnostic(ErrorCode.
ERR_InvalidQM
, "false ? x => x : x => x").WithArguments("lambda expression", "lambda expression"));
137
Diagnostic(ErrorCode.
ERR_InvalidQM
, "true ? GetVoid() : GetInt()").WithArguments("void", "int"));
159
Diagnostic(ErrorCode.
ERR_InvalidQM
, "true? 5 : color.Blue").WithArguments("int", "color"));
161
Diagnostic(ErrorCode.
ERR_InvalidQM
, "true? null : color.Blue").WithArguments("<null>", "color"));
Semantics\DelegateTypeTests.cs (4)
10703
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? () => string.Empty : () => string.Empty").WithArguments("lambda expression", "lambda expression").WithLocation(7, 18),
10706
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? F1 : () => string.Empty").WithArguments("method group", "lambda expression").WithLocation(8, 18),
10709
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? (object o) => { } : F2").WithArguments("lambda expression", "method group").WithLocation(9, 18),
10712
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? F2 : F2").WithArguments("method group", "method group").WithLocation(10, 18)
Semantics\DynamicTests.cs (4)
1266
Diagnostic(ErrorCode.
ERR_InvalidQM
, "s1 ? d2 : M").WithArguments("dynamic", "method group").WithLocation(13, 17),
1269
Diagnostic(ErrorCode.
ERR_InvalidQM
, "s1 ? M : d2").WithArguments("method group", "dynamic").WithLocation(14, 17),
1272
Diagnostic(ErrorCode.
ERR_InvalidQM
, "s1 ? ptr : d2").WithArguments("void*", "dynamic").WithLocation(15, 17),
1275
Diagnostic(ErrorCode.
ERR_InvalidQM
, "s1 ? d2 : ptr").WithArguments("dynamic", "void*").WithLocation(16, 17)
Semantics\FunctionPointerTests.cs (14)
2476
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? ptr1 : ptr2").WithArguments("delegate*<string, void>[]", "delegate*<ref string, void>[]").WithLocation(10, 13),
2479
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? ptr1 : ptr3").WithArguments("delegate*<string, void>[]", "delegate*<int, void>[]").WithLocation(11, 13),
2482
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? ptr1 : ptr4").WithArguments("delegate*<string, void>[]", "delegate* unmanaged[Cdecl]<string, void>[]").WithLocation(12, 13),
2485
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? ptr5 : ptr6").WithArguments("delegate*<string>[]", "delegate*<ref string>[]").WithLocation(18, 13),
2488
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? ptr5 : ptr7").WithArguments("delegate*<string>[]", "delegate*<int>[]").WithLocation(19, 13),
2491
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? ptr5 : ptr8").WithArguments("delegate*<string>[]", "delegate* unmanaged[Cdecl]<string>[]").WithLocation(20, 13)
2573
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? ptr1 : ptr3").WithArguments("delegate*<string>", "delegate*<ref string>").WithLocation(12, 13),
2576
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? ptr1 : ptr4").WithArguments("delegate*<string>", "delegate*<ref string?>").WithLocation(13, 13),
2582
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? ptr5 : ptr7").WithArguments("delegate*<string>", "delegate*<ref string>").WithLocation(21, 13),
2585
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? ptr5 : ptr8").WithArguments("delegate*<string>", "delegate*<ref string?>").WithLocation(22, 13),
2646
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? ptr1 : ptr3").WithArguments("delegate*<string, void>", "delegate*<ref string, void>").WithLocation(12, 13),
2649
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? ptr1 : ptr4").WithArguments("delegate*<string, void>", "delegate*<ref string?, void>").WithLocation(13, 13),
2655
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? ptr5 : ptr7").WithArguments("delegate*<string, void>", "delegate*<ref string, void>").WithLocation(21, 13),
2658
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? ptr5 : ptr8").WithArguments("delegate*<string, void>", "delegate*<ref string?, void>").WithLocation(22, 13),
Semantics\NullableReferenceTypesTests.cs (12)
54694
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? null: null").WithArguments("<null>", "<null>").WithLocation(9, 10),
54697
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? default: default").WithArguments("default", "default").WithLocation(14, 10),
54794
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? x : y").WithArguments("UnknownA?", "UnknownB?").WithLocation(15, 10),
54797
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? y : x").WithArguments("UnknownB?", "UnknownA?").WithLocation(16, 10)
54829
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? x : y").WithArguments("A", "B").WithLocation(7, 10),
54832
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? y : x").WithArguments("B", "A").WithLocation(8, 10),
54835
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? x : y").WithArguments("A", "C").WithLocation(12, 10),
54838
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? y : x").WithArguments("C", "A").WithLocation(13, 10),
54841
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? x : y").WithArguments("B", "C").WithLocation(17, 10),
54844
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? y : x").WithArguments("C", "B").WithLocation(18, 10)
54905
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? throw new Exception() : throw new Exception()").WithArguments("<throw expression>", "<throw expression>").WithLocation(6, 10));
88507
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? null : null").WithArguments("<null>", "<null>").WithLocation(8, 10),
Semantics\SemanticErrorTests.cs (5)
1555
Diagnostic(ErrorCode.
ERR_InvalidQM
, "true ? 0 : M2()").WithArguments("int", "void").WithLocation(6, 19)
6576
Diagnostic(ErrorCode.
ERR_InvalidQM
, "b ? a : c").WithArguments("A", "C").WithLocation(11, 15)
6615
Diagnostic(ErrorCode.
ERR_InvalidQM
, "1 > 2 ? a : b").WithArguments("A<string>", "A<int>").WithLocation(8, 17)
6642
Diagnostic(ErrorCode.
ERR_InvalidQM
, "true ? x : 1").WithArguments("S[]", "int"),
6648
Diagnostic(ErrorCode.
ERR_InvalidQM
, "false ? 1 : y").WithArguments("int", "C[]")
Semantics\StackAllocInitializerTests.cs (3)
1400
Diagnostic(ErrorCode.
ERR_InvalidQM
, "true ? stackalloc int [3] { 1, 2, 3 } : a").WithArguments("System.Span<int>", "System.Span<short>").WithLocation(8, 18),
1403
Diagnostic(ErrorCode.
ERR_InvalidQM
, "true ? stackalloc int [ ] { 1, 2, 3 } : a").WithArguments("System.Span<int>", "System.Span<short>").WithLocation(9, 18),
1406
Diagnostic(ErrorCode.
ERR_InvalidQM
, "true ? stackalloc [ ] { 1, 2, 3 } : a").WithArguments("System.Span<int>", "System.Span<short>").WithLocation(10, 18)
Semantics\StackAllocSpanExpressionsTests.cs (1)
307
Diagnostic(ErrorCode.
ERR_InvalidQM
, "true ? stackalloc int [10] : a").WithArguments("System.Span<int>", "System.Span<short>").WithLocation(8, 17)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\SymbolDistinguisherTests.cs (1)
489
Diagnostic(ErrorCode.
ERR_InvalidQM
, "args == null ? new C() : Lib.M()").WithArguments("C [file.cs(2)]", "C [Metadata, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]").WithLocation(6, 17));