101 references to ERR_ImplicitlyTypedArrayNoBestType
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder_Expressions.cs (2)
4129
Error(diagnostics, ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, node);
4156
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)
6405
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { () => 0, () => 1 }").WithLocation(8, 20));
7610
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { M1, (string s) => int.Parse(s) }").WithLocation(8, 18),
7613
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { (string s) => s.Length, M2 }").WithLocation(9, 18));
7643
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F1<object>, F1<string> }").WithLocation(8, 18),
7646
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F2<object>, F2<string> }").WithLocation(9, 18));
7674
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F1<int>, F1<object> }").WithLocation(8, 18),
7677
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F2<nint>, F2<System.IntPtr> }").WithLocation(9, 18),
7680
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F3<string>, F3<object> }").WithLocation(10, 18)
7713
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F<string?>, F<string> }").WithLocation(8, 18),
7716
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F<(int X, object Y)>, F<(int, dynamic)> }").WithLocation(9, 18));
7744
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { (object o) => { }, (string s) => { } }").WithLocation(6, 18),
7747
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { () => (object)null, () => (string)null }").WithLocation(7, 18));
7782
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F1<string>, F1<string> }").WithLocation(8, 18),
7785
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F2<object, string>, F2<object, string> }").WithLocation(9, 18));
7816
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F1<object>, F1<string> }").WithLocation(8, 18),
7819
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F2<object, string>, F2<object, object> }").WithLocation(9, 18)
7851
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F<object>, F<string> }").WithLocation(6, 18),
7854
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { (object x, ref object y) => { }, (string x, ref object y) => { } }").WithLocation(7, 18),
7857
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { (object x, ref object y) => { }, (object x, ref string y) => { } }").WithLocation(8, 18)
7891
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F<object>, null }").WithLocation(7, 18),
7894
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { default, F<string> }").WithLocation(8, 18),
7897
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { null, default, (object x, ref string y) => { } }").WithLocation(9, 18));
7935
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F1 }").WithLocation(8, 18),
7938
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F1, F2 }").WithLocation(9, 18),
7941
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F2, F1 }").WithLocation(10, 18),
7944
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { x => x }").WithLocation(11, 18),
7947
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { x => x, (int y) => y }").WithLocation(12, 18),
7950
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { (int y) => y, static x => x }").WithLocation(13, 18),
7953
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { x => x, F1 }").WithLocation(14, 18),
7956
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F1, (int y) => y }").WithLocation(15, 18));
7962
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { F1 }").WithLocation(8, 18),
7965
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { x => x }").WithLocation(11, 18),
7968
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { x => x, F1 }").WithLocation(14, 18));
8047
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { () => 1 }").WithLocation(6, 18));
18519
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { (int i = 1) => { }, (int i = 2) => { } }").WithLocation(1, 11));
19674
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { MethodNoParams, MethodWithParams }").WithLocation(7, 10),
19677
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { inferredNoParams, inferredWithParams }").WithLocation(8, 10),
19680
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { lambdaNoParams, lambdaWithParams }").WithLocation(9, 10),
19683
Diagnostic(ErrorCode.
ERR_ImplicitlyTypedArrayNoBestType
, "new[] { (int[] xs) => xs.Length, (params int[] xs) => xs.Length }").WithLocation(10, 10));
19923
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));