I have a routine
public void SomeRoutine(List<IFormattable> list) { ... }
I then try to call this routine
List<Guid>list = new List<Guid>();
list.Add(Guid.NewGuid());
SomeRoutine(list);
And it fails with a compile-time error. System.Guid implements IFormattable, but the error I get is
cannot convert from 'System.Collections.Generic.List' to 'System.Collections.Generic.List'
NOTE: You will get the same error if you just use an array of Guids. Generics is NOT the cause....
But! Given this
public void SomeRoutine2(IFormattable obj) { ... }
and this
Guid a = Guid.NewGuid();
SomeRoutine2(a);
It compiles! So the question is WHY? Why am I able to pass a Guid object (which implements IFormattable) into a routine that accepts an object of IFormattable, but when I try to expand that to a collection (a generic list, or an array, or anything else), I get a conversion error?
I have had a heck of a time finding an answer, and I figured this would be the best place to go.