[Mono-bugs] [Bug 391062] New: Unhandled exception when both equality and inequality operators have an unknown type as argument

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu May 15 17:40:19 EDT 2008


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


           Summary: Unhandled exception when both equality and inequality
                    operators have an unknown type as argument
           Product: Mono: Compilers
           Version: SVN
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: cedricv at neonux.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


If there is only one operator the exception does not happen.


cedric at laptop:~/tmp$ cat equalcrash.cs 

public abstract class EqualityOperatorWithUnknownTypeCrash
{

                public static bool operator
==(EqualityOperatorWithUnknownTypeCrash lhs, IDoNotExist rhs)
                {
                        return false;
                }

                public static bool operator
!=(EqualityOperatorWithUnknownTypeCrash lhs, IDoNotExist rhs)
                {
                        return !(lhs == rhs);
                }

}

cedric at laptop:~/tmp$ gmcs equalcrash.cs 
equalcrash.cs(5,90): error CS0246: The type or namespace name `IDoNotExist'
could not be found. Are you missing a using directive or an assembly reference?
equalcrash.cs(10,90): error CS0246: The type or namespace name `IDoNotExist'
could not be found. Are you missing a using directive or an assembly reference?

Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object
  at Mono.CSharp.TypeManager.IsEqual (System.Type a, System.Type b) [0x00000] 
  at Mono.CSharp.TypeManager.IsEqual (System.Type[] a, System.Type[] b)
[0x00000] 
  at Mono.CSharp.TypeContainer+OperatorArrayList.CheckPairedOperators ()
[0x00000] 
  at Mono.CSharp.TypeContainer+OperatorArrayList.DefineContainerMembers ()
[0x00000] 
  at Mono.CSharp.TypeContainer.DefineContainerMembers
(Mono.CSharp.MemberCoreArrayList mcal) [0x00000] 
  at Mono.CSharp.Class.DefineContainerMembers (Mono.CSharp.MemberCoreArrayList
list) [0x00000] 
  at Mono.CSharp.TypeContainer.DoDefineMembers () [0x00000] 
  at Mono.CSharp.Class.DoDefineMembers () [0x00000] 
  at Mono.CSharp.TypeContainer.DefineMembers () [0x00000] 
  at Mono.CSharp.RootContext.PopulateTypes () [0x00000] 
  at Mono.CSharp.Driver.Compile () [0x00000] 
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000]


-- 
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