[Mono-bugs] [Bug 31984][Maj] New - mcs doesn't correctly resolve const value uses depending on file compilation order

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
9 Oct 2002 06:11:10 -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 vladimir@pobox.com.

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

--- shadow/31984	Wed Oct  9 02:11:10 2002
+++ shadow/31984.tmp.833	Wed Oct  9 02:11:10 2002
@@ -0,0 +1,51 @@
+Bug#: 31984
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vladimir@pobox.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs doesn't correctly resolve const value uses depending on file compilation order
+
+given:
+
+/* t9b.cs */
+using System.Runtime.InteropServices;
+
+namespace Q {
+        public class Test {
+                [DllImport (T.X.Z.BLAH_LIB)]
+                public static extern int frob ();
+
+                public static void Main () {
+                }
+        }
+}
+/* end */
+
+/* t9a.cs */
+namespace T {
+        namespace X {
+                public class Z {
+                        public const string BLAH_LIB = "blah";
+                }
+        }
+}
+/* end */
+
+If compiled with "mcs -o t9 t9a.cs t9b.cs" everything is fine. However, if
+compild with "mcs -o t9 t9b.cs t9a.cs" (note switched order of files), I get:
+
+t9b.cs(5) error CS0117: `T.X.Z' does not contain a definition for `BLAH_LIB'
+
+csc behaves as expected.  Blocking future commit of gtk#-for-win32 patch,
+as it can't compile under linux without a hack :)