[Mono-list] Fwd: monodoc.dll looking for missing method in mscorlib.dll

A.M. Abdelaziz amamh3 at gmail.com
Mon Jan 4 13:06:34 EST 2010

I wrote the following code:

using System;
namespace csharpjava
        public class MainClass
                public static void Main ()
                        Type t1 = typeof(string);
                        Type t2 = typeof(string);
                        bool eq = t1 == t2;             // comparison is

If I compiled that with mcs or gmcs, then running monodis, I see they are
aompared using a function/method called "ceq":
        IL_0016:  ldloc.0
        IL_0017:  ldloc.1
        IL_0018:  ceq
        IL_001a:  stloc.2

but if I compile with dmcs, I see System.Type::op_Equality:
        IL_0016:  ldloc.0
        IL_0017:  ldloc.1
        IL_0018:  call bool class [mscorlib]System.Type::op_Equality(class
[mscorlib]System.Type, class [mscorlib]System.Type)
        IL_001d:  stloc.2

both versions print "True" when run by mono from svn or stable mono 2.6.1,
but of course the second version (compiled with dmcs) can't be run on mono
2.6.1 because it doesn't support .NET 4, giving a warning of unsupported
runtime version then exception of missing method op_Equality in
 /usr/lib/mono/1.0/mscorlib.dll then crashes.

does that give any insight why monodoc.dll doesn't work from svn, am I the
only one having this problem?
Thanks in advance

On Mon, Jan 4, 2010 at 7:48 PM, A.M. Abdelaziz <amamh3 at gmail.com> wrote:

> yes, u r right.
> I viewed monodis output, it's really just comparing references.
> Thanks!
> On Fri, Jan 1, 2010 at 1:54 AM, Chris Howie <cdhowie at gmail.com> wrote:
>> On Wed, Dec 30, 2009 at 4:11 PM, A.M. Abdelaziz <amamh3 at gmail.com> wrote:
>> > I think that method does exist in mscorlib.dll as I tried
>> > Console.WriteLine( typeof(string) == typeof(string) );
>> > it compiled and ran fine
>> > of course I compiled mono with the flag "--with-profile4=yes"
>> That doesn't necessarily mean that the overload does exist.  Reference
>> equality on Type objects usually works fine.
>> I'm not saying that the overload doesn't exist, all I'm saying is that
>> your test doesn't actually prove either case.  Try instead compiling
>> that example and running monodis on it.  The IL will show you if a
>> method call is being made or if it's just a ceq (reference
>> comparison).
>> --
>> Chris Howie
>> http://www.chrishowie.com
>> http://en.wikipedia.org/wiki/User:Crazycomputers
> --
> A.M. Abdelaziz

A.M. Abdelaziz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20100104/93b37782/attachment-0001.html 

More information about the Mono-list mailing list