[Mono-bugs] [Bug 389276] New: MemberCache. FindMemberToOverride fails due to a different behaviour of MethodBase. GetGenericArguments between Mono and original

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon May 12 05:57:48 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=389276


           Summary: MemberCache.FindMemberToOverride fails due to a
                    different behaviour of MethodBase.GetGenericArguments
                    between Mono and original
           Product: Mono: Compilers
           Version: 1.9.0
          Platform: x86
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: mihailik at gmail.com
         QAContact: mono-bugs at lists.ximian.com
        Depends on: 389272
          Found By: Other


Running under original .NET Framework

Mono.CSharp.MemberCache.FindMemberToOverride(Type invocation_type, string name,
Type [] 

param_types, GenericMethod generic_method, bool is_property)
in decl.cs ~2404ln
Fails due to a different behaviour of MethodBase.GetGenericArguments between
Mono and original Microsoft .NET Framework 2.0 SP1

NullReferenceException 
NET returns null as result to a call to GetGenericArguments, whereas Mono
returns an empty array.

Proposed workaround is to change Mono.CSharp.TypeManager class to be defensive
and translate Microsoft's null behaviour to Mono's empty array behaviour.
In particular, the proposed change is in typemanager.cs file ~line 2930:
        public static Type[] GetGenericArguments (MethodBase mi)
        {
#if GMCS_SOURCE
#if MS_COMPATIBLE
                                      return mi.GetGenericArguments() ??
Type.EmptyTypes;
#else
                return mi.GetGenericArguments ();
#endif
#else
                return Type.EmptyTypes;
#endif
        }


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list