61 references to ERR_ForEachMissingMember
Microsoft.CodeAnalysis.CSharp (3)
Binder\ForEachLoopBinder.cs (2)
815
(false, false, false) => ErrorCode.
ERR_ForEachMissingMember
,
989
diagnostics.Add(ErrorCode.
ERR_ForEachMissingMember
, collectionSyntax.Location, unwrappedCollectionExprType, WellKnownMemberNames.GetEnumeratorMethodName);
Errors\ErrorFacts.cs (1)
1253
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)
2800
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(9, 27)
2835
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "1").WithArguments("int", "GetEnumerator").WithLocation(7, 27)
2870
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new object()").WithArguments("object", "GetEnumerator").WithLocation(7, 27)
2905
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "(int?)1").WithArguments("int?", "GetEnumerator").WithLocation(7, 27)
2942
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "0").WithArguments("int", "GetEnumerator").WithLocation(9, 27)
3407
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new object()").WithArguments("object", "GetEnumerator").WithLocation(8, 27)
3438
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new object()").WithArguments("object", "GetEnumerator").WithLocation(8, 27)
3712
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27)
3751
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27)
3790
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27)
3860
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27)
3903
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(11, 27)
4047
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27)
4138
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27));
4236
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27),
4336
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "c").WithArguments("C", "GetEnumerator").WithLocation(7, 27),
4990
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27));
5282
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27)
CodeGen\CodeGenFunctionPointersTests.cs (1)
9333
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "c").WithArguments("C", "GetEnumerator").WithLocation(6, 27)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (13)
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)
19047
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "t").WithArguments("T", "GetEnumerator").WithLocation(36, 27)
Semantics\ExtensionTests.cs (7)
25465
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(3, 19));
25495
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(3, 19));
25525
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(3, 19));
25549
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(3, 19));
25574
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(3, 19));
25596
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(1, 19));
45581
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new object()").WithArguments("object", "GetEnumerator").WithLocation(1, 19));
Semantics\ExtensionTests2.cs (2)
34636
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "42").WithArguments("int", "GetEnumerator").WithLocation(1, 19),
34649
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "42").WithArguments("int", "GetEnumerator").WithLocation(1, 19));
Semantics\ParamsCollectionTests.cs (1)
1142
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)
6940
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "c").WithArguments("C", "GetEnumerator").WithLocation(6, 27),
7034
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "c").WithArguments("C", "GetEnumerator").WithLocation(6, 27),
7158
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "c").WithArguments("C", "GetEnumerator").WithLocation(6, 27)
7275
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)
708
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new Enumerable()").WithArguments("Enumerable", "GetEnumerator"));
739
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new Enumerable()").WithArguments("Enumerable", "GetEnumerator"));
772
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new Enumerable()").WithArguments("Enumerable", "GetEnumerator"));
805
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new Enumerable()").WithArguments("Enumerable", "GetEnumerator"));
808
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new Enumerable()").WithArguments("Enumerable", "GetEnumerator"));
1459
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "t").WithArguments("T", "GetEnumerator").WithLocation(17, 27));
1477
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "i").WithArguments("int", "GetEnumerator"));
2912
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "e1").WithArguments("System.Collections.Generic.IEnumerable<C>", "GetEnumerator"),
3159
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "e1").WithArguments("System.Collections.IEnumerable", "GetEnumerator"),
3440
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "myObj").WithArguments("myClass<System.Collections.Generic.List<string>>", "GetEnumerator").WithLocation(14, 27));
3506
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new { B, C }").WithArguments("<anonymous type: string B, string C>", "GetEnumerator").WithLocation(9, 27)
4228
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "lazyNonsense").WithArguments("System.Lazy<Nonsense>", "GetEnumerator").WithLocation(19, 29),
4246
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "nullableNonsense").WithArguments("Nonsense?", "GetEnumerator").WithLocation(39, 29),
4252
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)
14869
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "col").WithArguments("MyCollection", "GetEnumerator"));
14886
VerifyDiagnostics(Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "F(1)").WithArguments("void", "GetEnumerator"));