[Mono-bugs] [Bug 603299] New: [regression] CS0120 compiling a static method

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu May 6 09:19:52 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=603299

http://bugzilla.novell.com/show_bug.cgi?id=603299#c0


           Summary: [regression] CS0120 compiling a static method
    Classification: Mono
           Product: Mono: Compilers
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: spouliot at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


[mono] ~/src/bugzilla @ gmcs de.cs
de.cs(6,28): error CS0120: An object reference is required to access non-static
member `double.Equals(object)'
Compilation failed: 1 error(s), 0 warnings

[mono] ~/src/bugzilla @ cat de.cs
using System;

public static class Test {
       public static void AreEqual(double expected, double actual)
        {
                if(!Double.Equals (expected, actual))
            throw new Exception ();
    }
}

Using CSC (or older GMCS) this would compile into

call bool [mscorlib]System.Object::Equals(object,object)

-- 
Configure bugmail: http://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