But that is the call of the interface members. Each of them choses the right
interface member. The problem is, how the interface member is maped to the
methods.
Agreed.
The calling occurs on a constructed class, where the two overloads can
clearly ditinguished.
The interface mapping for NastyFooImpl occurs on a constructed type, where
the members can't be distinguished. We'de have to look how the interface
mapping is defined in the IL to see, if the C# compiler or the CLR makes the
decission.
I've made what I think is a fairly important discovery, in terms of
the difference that is made by reordering the interface members. One
way round, the IL for the explicit implementation is:
.override method instance void class IFoo`2<int32,int32>::Bar(!
1, !1)
The other way round, it's
.override method instance void class IFoo`2<int32,int32>::Bar(!
0, !1)
In other words it's explicitly implementing different methods, which
explains everything else, I think. That would put the ball in the C#
compiler's court (rather than the CLR's) but it doesn't answer whether
it's a C# compiler *bug* or a problem with the spec.
Jon