[Mono-bugs] [Bug 59324][Wis] New - IdenticalNameAndTypeName is too permissive

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 30 May 2004 16:28:03 -0400 (EDT)


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 bmaurer@users.sf.net.

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

--- shadow/59324	2004-05-30 16:28:03.000000000 -0400
+++ shadow/59324.tmp.7657	2004-05-30 16:28:03.000000000 -0400
@@ -0,0 +1,36 @@
+Bug#: 59324
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: bmaurer@users.sf.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: IdenticalNameAndTypeName is too permissive
+
+Consider:
+
+class A {
+	public static int X;
+}
+
+class T {
+	static void Main () {
+		A T = new A ();
+		System.Console.WriteLine (T.X);
+	}
+}
+
+We compile this, and print `0'. The reason is that when we see `A.X' it is
+a static field. However, it is being accessed as an instance field. For
+correctness, we check to see if `T' is a type. Indeed, it is.
+
+The check we really need to do is `is T a type that holds X'