I don't get how this worked even without reflection.  In C# (like C++ I
thought) you could not have the return type as the only difference in
the signature.  How would the compiler figure out which to call?

Thanks,

Shawn Wildermuth
[EMAIL PROTECTED]

> -----Original Message-----
> From: dotnet discussion [mailto:[EMAIL PROTECTED]]
> On Behalf Of Brent E. Rector
> Sent: Saturday, May 18, 2002 3:26 PM
> To: [EMAIL PROTECTED]
> Subject: [DOTNET] BUG: Remoting does not distinguish methods
> differing only by return type
>
>
> Remoting throws an ambiguous match exception when calling a
> method on a remote MBR object that differs from another
> method of the type only by the return type. Here's an example
> using pseudo-C# syntax:
>
>   internal class AppDomainInfoFetcher : System.MarshalByRefObject {
>     internal AppDomainInfo a (AssemblyName name) { . . . }
>     internal AssemblyName[] a (AssemblyName name) { . . . }
>     }
>   }
>
> Partition I 7.5.2       Assemblies and Scoping
> Generally, names are not unique. Names are collected into
> groupings called scopes. Within a scope, a name may refer to
> multiple entities as long as they are of different kinds
> (methods, fields, nested types, properties, and events) or
> have different signatures.
>
> [Brent] The two methods called 'a' above have differing
> signatures. Only CLS Rule 6 requires the return type part of
> a signature to be ignored. But Remoting should work for
> non-CLS compliant types too.
>
> CLS Rule 6: Fields and nested types shall be distinct by
> identifier comparison alone, even though the CTS allows
> distinct signatures to be distinguished.  Methods,
> properties, and events that have the same name (by identifier
> comparison) shall differ by more than just the return type,
> except as specified in CLS Rule 39.
>
>
> -- Brent Rector, .NET Wise Owl
> Demeanor for .NET - an obfuscation utility
> http://www.wiseowl.com/Products/Products.aspx
>
> You can read
> messages from the DOTNET archive, unsubscribe from DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.
>

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to