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: [email protected]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [email protected]
          Found By: ---


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


[EMAIL PROTECTED]:~/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);
                }

}

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

Reply via email to