Reputation:
Why am I not able to use the boolean parameter in this statement? It's showing me this error:
No best type found for implicitly-typed array
public IEnumerator GetEnumerator()
{
yield return new[] { "ABC123", "9999", "9999", "1000", "20180427120717123", false };
}
Upvotes: 2
Views: 1295
Reputation: 186833
It seems, that you want to enumerate object[]
s:
public IEnumerator<object[]> GetEnumerator() {
yield return new object[] { "ABC123", "9999", "9999", "1000", "20180427120717123", false };
yield return new object[] { "ABC123", "9999", "9999", "1000", "20180427120717123", true };
}
Upvotes: 1
Reputation: 1064184
If you want a mixed array: just don't be vague:
yield return new object[] { "ABC123", ..., false }
The difference is the new object[] {...}
instead of new [] {...}
, which means that the compiler doesn't need to try to figure out what you meant.
Upvotes: 5