47 references to ERR_ForEachMissingMember
Microsoft.CodeAnalysis.CSharp (3)
Binder\ForEachLoopBinder.cs (2)
732
: (isAsync ? ErrorCode.ERR_AwaitForEachMissingMember : ErrorCode.
ERR_ForEachMissingMember
);
804
diagnostics.Add(ErrorCode.
ERR_ForEachMissingMember
, _syntax.Expression.Location, unwrappedCollectionExprType, GetEnumeratorMethodName);
Errors\ErrorFacts.cs (1)
1189
case ErrorCode.
ERR_ForEachMissingMember
:
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (19)
CodeGen\CodeGenForEachTests.cs (18)
2410
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "(object)null").WithArguments("object", "GetEnumerator").WithLocation(7, 27)
2806
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(9, 27)
2841
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "1").WithArguments("int", "GetEnumerator").WithLocation(7, 27)
2876
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new object()").WithArguments("object", "GetEnumerator").WithLocation(7, 27)
2911
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "(int?)1").WithArguments("int?", "GetEnumerator").WithLocation(7, 27)
2948
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "0").WithArguments("int", "GetEnumerator").WithLocation(9, 27)
3412
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new object()").WithArguments("object", "GetEnumerator").WithLocation(8, 27)
3443
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new object()").WithArguments("object", "GetEnumerator").WithLocation(8, 27)
3717
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27)
3756
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27)
3795
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27)
3865
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27)
3908
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(11, 27)
4052
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27)
4143
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27));
4241
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27),
4882
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27));
5174
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new C()").WithArguments("C", "GetEnumerator").WithLocation(7, 27)
CodeGen\CodeGenFunctionPointersTests.cs (1)
9322
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "c").WithArguments("C", "GetEnumerator").WithLocation(6, 27)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (5)
IOperation\IOperationTests_IForEachLoopStatement.cs (5)
3549
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "e").WithArguments("MyClass", "GetEnumerator").WithLocation(6, 27)
6950
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "c").WithArguments("C", "GetEnumerator").WithLocation(6, 27),
7044
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "c").WithArguments("C", "GetEnumerator").WithLocation(6, 27),
7168
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "c").WithArguments("C", "GetEnumerator").WithLocation(6, 27)
7285
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)
82
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "NULL").WithArguments("object", "GetEnumerator").WithLocation(7, 27)
191
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new Enumerable()").WithArguments("Enumerable", "GetEnumerator"));
222
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new Enumerable()").WithArguments("Enumerable", "GetEnumerator"));
255
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new Enumerable()").WithArguments("Enumerable", "GetEnumerator"));
288
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new Enumerable()").WithArguments("Enumerable", "GetEnumerator"));
291
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new Enumerable()").WithArguments("Enumerable", "GetEnumerator"));
942
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "t").WithArguments("T", "GetEnumerator").WithLocation(17, 27));
960
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "i").WithArguments("int", "GetEnumerator"));
2395
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "e1").WithArguments("System.Collections.Generic.IEnumerable<C>", "GetEnumerator"),
2642
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "e1").WithArguments("System.Collections.IEnumerable", "GetEnumerator"),
2923
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "myObj").WithArguments("myClass<System.Collections.Generic.List<string>>", "GetEnumerator").WithLocation(14, 27));
2989
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "new { B, C }").WithArguments("<anonymous type: string B, string C>", "GetEnumerator").WithLocation(9, 27)
3665
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "lazyNonsense").WithArguments("System.Lazy<Nonsense>", "GetEnumerator").WithLocation(19, 29),
3683
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "nullableNonsense").WithArguments("Nonsense?", "GetEnumerator").WithLocation(39, 29),
3689
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)
14709
Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "col").WithArguments("MyCollection", "GetEnumerator"));
14726
VerifyDiagnostics(Diagnostic(ErrorCode.
ERR_ForEachMissingMember
, "F(1)").WithArguments("void", "GetEnumerator"));