101 references to ERR_ImplicitlyTypedArrayNoBestType
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder_Expressions.cs (2)
4138
Error(diagnostics, ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, node);
4165
Error(diagnostics, ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, node);
Errors\ErrorFacts.cs (1)
1116
or ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
CodeGen\CodeGenImplicitlyTypeArraysTests.cs (2)
141
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new [] {E.START, 0, 0U, 0u, 0L, 0l, 0UL, 0Ul, 0uL, 0ul, 0LU, 0Lu, 0lU, 0lu}").WithLocation(15, 21),
999
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { E.FortyTwo, 0 }").WithLocation(16, 21));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
Semantics\CollectionExpressionTests.cs (3)
2033
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { default }").WithLocation(5, 19),
3278
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, @"new[] { [[""""]], [new object[0]] }").WithLocation(6, 17));
3366
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { [1, 2, 3] }").WithLocation(9, 29));
Semantics\ParamsCollectionTests.cs (1)
5521
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { default }").WithLocation(5, 19),
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (4)
IOperation\IOperationTests_ArrayCreationAndInitializer.cs (2)
423
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[]/*</bind>*/").WithLocation(6, 27)
461
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[2]/*</bind>*/").WithLocation(6, 27)
IOperation\IOperationTests_StackAllocArrayCreationAndInitializer.cs (2)
387
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "stackalloc[]/*</bind>*/").WithLocation(6, 27)
422
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "stackalloc[2]/*</bind>*/").WithLocation(6, 27)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (86)
Semantics\DelegateTypeTests.cs (40)
6379
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { () => 0, () => 1 }").WithLocation(8, 20));
7584
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { M1, (string s) => int.Parse(s) }").WithLocation(8, 18),
7587
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { (string s) => s.Length, M2 }").WithLocation(9, 18));
7617
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F1<object>, F1<string> }").WithLocation(8, 18),
7620
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F2<object>, F2<string> }").WithLocation(9, 18));
7648
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F1<int>, F1<object> }").WithLocation(8, 18),
7651
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F2<nint>, F2<System.IntPtr> }").WithLocation(9, 18),
7654
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F3<string>, F3<object> }").WithLocation(10, 18)
7687
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F<string?>, F<string> }").WithLocation(8, 18),
7690
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F<(int X, object Y)>, F<(int, dynamic)> }").WithLocation(9, 18));
7718
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { (object o) => { }, (string s) => { } }").WithLocation(6, 18),
7721
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { () => (object)null, () => (string)null }").WithLocation(7, 18));
7756
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F1<string>, F1<string> }").WithLocation(8, 18),
7759
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F2<object, string>, F2<object, string> }").WithLocation(9, 18));
7790
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F1<object>, F1<string> }").WithLocation(8, 18),
7793
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F2<object, string>, F2<object, object> }").WithLocation(9, 18)
7825
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F<object>, F<string> }").WithLocation(6, 18),
7828
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { (object x, ref object y) => { }, (string x, ref object y) => { } }").WithLocation(7, 18),
7831
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { (object x, ref object y) => { }, (object x, ref string y) => { } }").WithLocation(8, 18)
7865
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F<object>, null }").WithLocation(7, 18),
7868
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { default, F<string> }").WithLocation(8, 18),
7871
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { null, default, (object x, ref string y) => { } }").WithLocation(9, 18));
7909
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F1 }").WithLocation(8, 18),
7912
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F1, F2 }").WithLocation(9, 18),
7915
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F2, F1 }").WithLocation(10, 18),
7918
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { x => x }").WithLocation(11, 18),
7921
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { x => x, (int y) => y }").WithLocation(12, 18),
7924
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { (int y) => y, static x => x }").WithLocation(13, 18),
7927
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { x => x, F1 }").WithLocation(14, 18),
7930
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F1, (int y) => y }").WithLocation(15, 18));
7936
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F1 }").WithLocation(8, 18),
7939
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { x => x }").WithLocation(11, 18),
7942
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { x => x, F1 }").WithLocation(14, 18));
8021
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { () => 1 }").WithLocation(6, 18));
18493
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { (int i = 1) => { }, (int i = 2) => { } }").WithLocation(1, 11));
19648
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { MethodNoParams, MethodWithParams }").WithLocation(7, 10),
19651
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { inferredNoParams, inferredWithParams }").WithLocation(8, 10),
19654
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { lambdaNoParams, lambdaWithParams }").WithLocation(9, 10),
19657
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { (int[] xs) => xs.Length, (params int[] xs) => xs.Length }").WithLocation(10, 10));
19897
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, @"new[]
Semantics\ForEachTests.cs (2)
1113
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { Main() }"));
1135
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { Main() }"),
Semantics\FunctionPointerTests.cs (7)
2408
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { ptr1, ptr2 }").WithLocation(10, 20),
2411
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { ptr1, ptr3 }").WithLocation(11, 20),
2414
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { ptr1, ptr4 }").WithLocation(12, 20),
2417
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { ptr5, ptr6 }").WithLocation(18, 20),
2420
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { ptr5, ptr7 }").WithLocation(19, 20),
2423
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { ptr5, ptr8 }").WithLocation(20, 20)
2537
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { i1, i2 }").WithLocation(12, 47)
Semantics\ImplicitObjectCreationTests.cs (1)
3062
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { new(), new() }").WithLocation(6, 17)
Semantics\NativeIntegerTests.cs (4)
14258
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { x, y }").WithLocation(9, 10),
14261
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { y, x }").WithLocation(10, 10),
14310
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { x, y }").WithLocation(8, 13),
14319
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { x, y }").WithLocation(14, 13),
Semantics\NullableReferenceTypesTests.cs (5)
60960
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { }").WithLocation(5, 17),
60963
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { null }").WithLocation(6, 17));
160812
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "stackalloc[] { }").WithLocation(7, 18),
160815
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "stackalloc[] { null }").WithLocation(8, 18),
160818
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "stackalloc[] { x => x }").WithLocation(9, 18)
Semantics\ObjectAndCollectionInitializerTests.cs (1)
3224
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { Main() }"));
Semantics\RefFieldTests.cs (2)
17973
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { (R r) => { }, (scoped R r) => { } }").WithLocation(6, 18),
17976
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { (ref R r) => { }, (scoped ref R r) => { } }").WithLocation(8, 18));
Semantics\SemanticErrorTests.cs (11)
12395
new ErrorDescription { Code = (int)ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, Line = 12, Column = 17 },
12396
new ErrorDescription { Code = (int)ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, Line = 20, Column = 22 },
12397
new ErrorDescription { Code = (int)ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, Line = 22, Column = 17 },
12398
new ErrorDescription { Code = (int)ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, Line = 25, Column = 19 },
12399
new ErrorDescription { Code = (int)ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, Line = 27, Column = 18 },
12400
new ErrorDescription { Code = (int)ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, Line = 28, Column = 18 },
12401
new ErrorDescription { Code = (int)ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, Line = 30, Column = 18 },
12402
new ErrorDescription { Code = (int)ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, Line = 31, Column = 18 },
12403
new ErrorDescription { Code = (int)ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, Line = 33, Column = 18 },
12404
new ErrorDescription { Code = (int)ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, Line = 34, Column = 18 },
12405
new ErrorDescription { Code = (int)ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, Line = 36, Column = 17 }});
Semantics\StackAllocInitializerTests.cs (12)
144
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "stackalloc[] { new A(), new B() }").WithLocation(9, 18),
147
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "stackalloc[] { }").WithLocation(10, 18),
150
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "stackalloc[] { VoidMethod() }").WithLocation(11, 18),
153
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "stackalloc[] { null }").WithLocation(12, 18),
156
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "stackalloc[] { (1, null) }").WithLocation(13, 18),
162
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "stackalloc[] { new {} , new { i = 0 } }").WithLocation(15, 18),
206
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "stackalloc[] { new A(), new B() }").WithLocation(9, 32),
209
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "stackalloc[] { }").WithLocation(10, 32),
212
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "stackalloc[] { VoidMethod() }").WithLocation(11, 32),
215
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "stackalloc[] { null }").WithLocation(12, 32),
218
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "stackalloc[] { (1, null) }").WithLocation(13, 32),
224
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "stackalloc[] { new {} , new { i = 0 } }").WithLocation(15, 32),
Semantics\TargetTypedDefaultTests.cs (1)
2254
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { default, default }").WithLocation(6, 17)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Parsing\ParserErrorMessageTests.cs (2)
5576
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new [] { }").WithLocation(6, 17));
5586
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new [] { }").WithLocation(6, 17));