[Mono-list] Converting list types

Chris Seaton chris at chrisseaton.com
Tue Mar 6 18:46:44 EST 2007


gmcs says that it

Cannot convert from  
`System.Collections.Generic.List<Katahdin.Grammars.ParseGraphNode>'  
to `System.Collections.Generic.List<Katahdin.Grammars.IParseable>'

ParseGraphNode implements IParseable, so I would have thought that  
the compiler would allow that, but since it doesn't, what is the best  
way to convert from List<InterfaceImplementation> to List<Interface>?  
I know I can instantiate a new List<Interface> and copy one by one  
into that, but it seems a very common operation - is there a shortcut?

Thanks.

Chris Seaton


More information about the Mono-list mailing list