58 references to ERR_ForEachMissingMember
Microsoft.CodeAnalysis.CSharp (3)
Binder\ForEachLoopBinder.cs (2)
812
(false, false, false) => ErrorCode.
ERR_ForEachMissingMember
,
990
diagnostics.Add(ErrorCode.
ERR_ForEachMissingMember
, collectionSyntax.Location, unwrappedCollectionExprType, WellKnownMemberNames.GetEnumeratorMethodName);
Errors\ErrorFacts.cs (1)
1251
or ErrorCode.
ERR_ForEachMissingMember
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (20)
CodeGen\CodeGenForEachTests.cs (19)
2416
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "(object)null").WithArguments("object", "GetEnumerator").WithLocation(7, 27)
2812
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(9, 27)
2847
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "1").WithArguments("int", "GetEnumerator").WithLocation(7, 27)
2882
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new object()").WithArguments("object", "GetEnumerator").WithLocation(7, 27)
2917
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "(int?)1").WithArguments("int?", "GetEnumerator").WithLocation(7, 27)
2954
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "0").WithArguments("int", "GetEnumerator").WithLocation(9, 27)
3419
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new object()").WithArguments("object", "GetEnumerator").WithLocation(8, 27)
3450
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new object()").WithArguments("object", "GetEnumerator").WithLocation(8, 27)
3724
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27)
3763
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27)
3802
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27)
3872
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27)
3915
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(11, 27)
4059
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27)
4150
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27));
4248
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27),
4348
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "c").WithArguments("C", "GetEnumerator").WithLocation(7, 27),
5002
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27));
5294
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27)
CodeGen\CodeGenFunctionPointersTests.cs (1)
9335
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "c").WithArguments("C", "GetEnumerator").WithLocation(6, 27)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (10)
FirstClassSpanTests.cs (1)
312
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "a.R()").WithArguments("void", "GetEnumerator").WithLocation(8, 27)
RefStructInterfacesTests.cs (2)
8438
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "t").WithArguments("T", "GetEnumerator").WithLocation(37, 27)
18649
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "t").WithArguments("T", "GetEnumerator").WithLocation(36, 27)
Semantics\ExtensionTests.cs (6)
21236
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(3, 19));
21266
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(3, 19));
21296
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(3, 19));
21320
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(3, 19));
21345
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(3, 19));
21367
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(1, 19));
Semantics\ParamsCollectionTests.cs (1)
1150
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "a").WithArguments("MyCollection", "GetEnumerator").WithLocation(26, 27)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (5)
IOperation\IOperationTests_IForEachLoopStatement.cs (5)
3545
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "e").WithArguments("MyClass", "GetEnumerator").WithLocation(6, 27)
6942
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "c").WithArguments("C", "GetEnumerator").WithLocation(6, 27),
7036
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "c").WithArguments("C", "GetEnumerator").WithLocation(6, 27),
7160
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "c").WithArguments("C", "GetEnumerator").WithLocation(6, 27)
7277
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "c").WithArguments("C", "GetEnumerator").WithLocation(6, 27)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (20)
Semantics\DeconstructionTests.cs (2)
3632
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "1").WithArguments("int", "GetEnumerator").WithLocation(6, 55),
3711
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "M(x1)").WithArguments("(int, int)", "GetEnumerator").WithLocation(6, 34),
Semantics\ForEachTests.cs (15)
83
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "NULL").WithArguments("object", "GetEnumerator").WithLocation(7, 27)
192
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new Enumerable()").WithArguments("Enumerable", "GetEnumerator"));
223
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new Enumerable()").WithArguments("Enumerable", "GetEnumerator"));
256
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new Enumerable()").WithArguments("Enumerable", "GetEnumerator"));
289
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new Enumerable()").WithArguments("Enumerable", "GetEnumerator"));
292
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new Enumerable()").WithArguments("Enumerable", "GetEnumerator"));
943
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "t").WithArguments("T", "GetEnumerator").WithLocation(17, 27));
961
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "i").WithArguments("int", "GetEnumerator"));
2396
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "e1").WithArguments("System.Collections.Generic.IEnumerable<C>", "GetEnumerator"),
2643
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "e1").WithArguments("System.Collections.IEnumerable", "GetEnumerator"),
2924
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "myObj").WithArguments("myClass<System.Collections.Generic.List<string>>", "GetEnumerator").WithLocation(14, 27));
2990
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new { B, C }").WithArguments("<anonymous type: string B, string C>", "GetEnumerator").WithLocation(9, 27)
3712
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "lazyNonsense").WithArguments("System.Lazy<Nonsense>", "GetEnumerator").WithLocation(19, 29),
3730
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "nullableNonsense").WithArguments("Nonsense?", "GetEnumerator").WithLocation(39, 29),
3736
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "nonsenseTuple").WithArguments("(Nonsense, int)", "GetEnumerator").WithLocation(43, 29));
Semantics\ReadOnlyStructsTests.cs (1)
1865
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "this").WithArguments("S1", "GetEnumerator").WithLocation(6, 27));
Semantics\SemanticErrorTests.cs (2)
14822
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "col").WithArguments("MyCollection", "GetEnumerator"));
14839
VerifyDiagnostics(Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "F(1)").WithArguments("void", "GetEnumerator"));