[rdnzl-devel] .NET error : Ambiguous match found.
Iver Odin Kvello
iverodin at gmail.com
Tue Apr 8 14:29:47 UTC 2008
> Your direct invocation of the "get_Controls" method gets me going again.
I'm glad that works, but reflecting on this it seems that one pretty
much *have* to offer the return-type to PROPERTY/GetProperty when
there are ambiguities of this sort, which there will be. That's a bit
iffy syntactically, even though the implementation is easy enough. And
of course the error-message would still be pretty confusing.
C#'s type inference mechanism tells me that in the example, if foo
has type TestPropertiesB, then bar in
var bar = foo.MyProperty();
has type String, this being an error:
var bar = (int) foo.MyProperty();
whereas in
var bar = ((TestPropertiesA) foo).MyProperty();
bar is an int.
I guess one could write a custom Binder that would implement a 'most
specific property' thing, but that does kind of feel like overkill.
Regards,
Iver
More information about the rdnzl-devel
mailing list