[Mono-bugs] [Bug 28189][Wis] New - type/member name lookup problem

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
25 Jul 2002 14:01:39 -0000


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by lupus@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=28189

--- shadow/28189	Thu Jul 25 10:01:39 2002
+++ shadow/28189.tmp.16071	Thu Jul 25 10:01:39 2002
@@ -0,0 +1,61 @@
+Bug#: 28189
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: lupus@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Summary: type/member name lookup problem
+
+From a mail by Erik to mono-list:
+------
+using System;
+
+public class ZipEntry
+{
+    DateTime cal = DateTime.Now;
+    string name;
+
+    public ZipEntry(string name)
+    {
+        this.name = name;
+    }
+
+    public ZipEntry(ZipEntry e)
+    {
+        name = e.name;
+    }
+
+    public DateTime DateTime {
+        get {
+            return cal;
+        }
+    }
+
+}
+-----
+
+: [bagfors@detrius]$ ; mcs --target library  test2.cs
+test2.cs(5) error CS0176: Static member `Now' cannot be accessed with an
+instance reference, qualify with a type name instead
+Compilation failed: 1 error(s), 0 warnings
+[Exit 1 ]
+
+
+It seams like there is some resolving that is wrong.  The line "DateTime
+cal = DateTime.Now;" seams to use the DateTime attribute defined later
+instead of using System.DateTime.New like it should.
+
+Changing the line to "DateTime cal = System.DateTime.Now" solves the
+problem, or renaming the attribute, or removing any of the constructors
+(yes.. both are needed to get this error).
+
+The code works great in csc btw,