|
-
May 11th, 2011, 11:09 AM
#1
Most confusing error I have ever encountered
Hi all.
I am trying to make an app for the .NET framework, and am going well, except that when I tried to implement IEnumerable on a custom object I get the following error:
"Connot implicitly convert type 'System.Collections.Generic.IEnumerator<MyClass>' to 'System.Collections.Generic.IEnumerator<MyClass>'. An explicit conversion exists (are you missing a cast?)"
It might just be me, but that does not make any sense what-so-ever.
Context:
public class MyClass...
public class MyClassCollection
{
private List<MyClass> InnerList;
public IEnumerable<MyClass> GetEnumerator()
{
return ((IEnumerable<MyClass>)this.InnerList).GetEnumerator(); // Line that has error
}
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|