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: [email protected]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [email protected]
        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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to