[Mono-bugs] [Bug 28176][Nor] New - instance/static confusion in multiple field lookup
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
24 Jul 2002 20:39:25 -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=28176
--- shadow/28176 Wed Jul 24 16:39:25 2002
+++ shadow/28176.tmp.31380 Wed Jul 24 16:39:25 2002
@@ -0,0 +1,40 @@
+Bug#: 28176
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: lupus@ximian.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: instance/static confusion in multiple field lookup
+
+The following sample fails to compile with mcs with either runtime.
+The sample is extracted from csvorbis (alp reported it didn't compile).
+The error is:
+duh.cs(10) error CS0120: An object reference is required for the non-static
+field `s'
+It works if the access to the 'a' field is done in two steps:
+S temp = look.s;
+return temp.a;
+== cut cut ==
+class B {
+ public S s;
+}
+class S {
+ public int a;
+}
+class T {
+ static int blah (object arg) {
+ B look = (B)arg;
+ return look.s.a;
+ }
+ static void Main() {}
+}