64 references to ERR_CollectionExpressionNoTargetType
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Expressions.cs (1)
433diagnostics.Add(ErrorCode.ERR_CollectionExpressionNoTargetType, expr.Syntax.GetLocation());
Errors\ErrorFacts.cs (1)
2397or ErrorCode.ERR_CollectionExpressionNoTargetType
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (49)
Semantics\CollectionExpressionTests.cs (43)
197Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[]").WithLocation(7, 17)); 232Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[3]").WithLocation(7, 17)); 267Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, @"[3, """"]").WithLocation(7, 17)); 295Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[null]").WithLocation(7, 17)); 317Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[1, 2, null]").WithLocation(5, 17), 380Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[[3]]").WithLocation(5, 17)); 555Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[null, 1]").WithLocation(5, 17), 588Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[(null, default)]").WithLocation(12, 18), 591Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[i switch { _ => default }]").WithLocation(13, 18), 597Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[i == 0 ? null : default]").WithLocation(14, 18), 3465Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[1, 2, 3]").WithLocation(9, 17)); 3506Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[4]").WithLocation(27, 17)); 3539Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[4]").WithLocation(16, 13)); 4464Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[() => 1]").WithLocation(7, 29)); 4816Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[4]").WithLocation(27, 17) 4838Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[]").WithLocation(5, 9), 4841Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[]").WithLocation(6, 9), 4844Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[]").WithLocation(7, 9)); 4865Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[1]").WithLocation(5, 9), 4868Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[2]").WithLocation(6, 9), 4871Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[3]").WithLocation(7, 9)); 4892Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[]").WithLocation(5, 13), 4895Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[]").WithLocation(6, 13), 4898Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[]").WithLocation(7, 13)); 4919Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[1]").WithLocation(5, 13), 4922Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[2]").WithLocation(6, 13), 4925Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[3]").WithLocation(7, 13)); 7933Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[p]").WithLocation(7, 17), 7936Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[d]").WithLocation(8, 17)); 11566Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[]").WithLocation(5, 26)); 11587Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[]").WithLocation(6, 21), 11590Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[default]").WithLocation(7, 16)); 24037Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[default(TypedReference)]").WithLocation(6, 17), 24040Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[default(ArgIterator)]").WithLocation(7, 17), 24043Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[default(RuntimeArgumentHandle)]").WithLocation(8, 17)); 24068Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[default(R)]").WithLocation(10, 17), 24071Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[new R(ref i)]").WithLocation(11, 17)); 30396Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[]").WithLocation(7, 17)); 30482Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[]").WithLocation(7, 9), 30505Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[]").WithLocation(7, 9), 30528Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[]").WithLocation(7, 9), 30551Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[]").WithLocation(7, 9), 30790Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[3]").WithLocation(1, 14)
Semantics\CollectionExpressionTests_WithElement_ArraysAndSpans.cs (3)
697Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[with(), 1, 2, 3]").WithLocation(5, 21)); 718Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[with(), 1, 2, 3]").WithLocation(7, 20)); 739Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[with(), 1, 2, 3]").WithLocation(7, 20));
Semantics\CollectionExpressionTests_WithElement_Constructor.cs (1)
1311Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[with(capacity: 10)]").WithLocation(8, 20));
Semantics\ParamsCollectionTests.cs (2)
7942Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[3, 4]").WithLocation(13, 21), 7945Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[3, 4]").WithLocation(21, 22)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
IOperation\IOperationTests_IArrayElementReferenceExpression.cs (1)
530Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[0]").WithLocation(6, 27)
IOperation\IOperationTests_ICollectionExpressionOperation.cs (1)
3842Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[a]").WithLocation(10, 31));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (11)
Semantics\ForEachTests.cs (1)
620Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[]").WithLocation(5, 27));
Semantics\ImplicitObjectCreationTests.cs (10)
6785Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[new(out var x), x]").WithLocation(8, 17), 6867Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[new(out var x)]").WithLocation(8, 21) 6907Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[new(out var x), x]").WithLocation(8, 21), 7038Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[[new(out var x)], x]").WithLocation(8, 22), 7063Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[[new(out var x)]]").WithLocation(8, 22) 7389Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[new(out var x), new C()]").WithLocation(12, 28), 7421Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[new(out var y), new C()]").WithLocation(13, 28) 7454Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[GetInt(out var x)]").WithLocation(11, 28), 7491Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[GetInt(out var y), y]").WithLocation(12, 28) 7515Diagnostic(ErrorCode.ERR_CollectionExpressionNoTargetType, "[new(out var y), new C(out _)]").WithLocation(8, 16)