[Mono-bugs] [Bug 34793][Nor] New - mcs doesn't report error CS0027

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
30 Nov 2002 19:16:08 -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 bugbuddy-import@ximian.com.

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

--- shadow/34793	Sat Nov 30 14:16:08 2002
+++ shadow/34793.tmp.17553	Sat Nov 30 14:16:08 2002
@@ -0,0 +1,90 @@
+Bug#: 34793
+Product: Mono/MCS
+Version: unspecified
+OS: GNU/Linux [Other]
+OS Details: 
+Status: UNCONFIRMED   
+Resolution: 
+Severity: Unknown
+Priority: Normal
+Component: Misc
+AssignedTo: triage@ximian.com                            
+ReportedBy: jaimemonkey@yahoo.es               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs doesn't report error CS0027
+
+Package: Mono/MCS
+Priority: Normal
+Version: CVS Nov29-2002
+Synopsis: mcs doesn't report error CS0027
+Bugzilla-Product: Mono/MCS
+Bugzilla-Component: Misc
+
+Description:
+Description of Problem:
+
+mcs doesn't report CS0027.
+
+Steps to reproduce the problem:
+You can use the mcs/errors/cs0027.cs test in the CVS, that is:
+
+// cs0027.cs: Keyword 'this' can't be used outside a constructor, a
+method or a property.
+// Line: 7
+
+using System;
+
+class Error0027 {
+        int i = this.x;
+        int x = 0;
+
+        public static void Main () {
+                Console.WriteLine ("The compiler should complain: Error
+CS0027 trying to use 'this' outside context.");
+                Console.WriteLine ("Trying to assign i to 'this.x'
+outside a method, property or ctr.");
+        }
+}
+
+Or you can use the second test:
+mcs/errors/cs0027-2.cs in the CVS:
+
+// cs0027-2.cs: Keyword 'this' can't be used outside a constructor, a
+method or a property.
+// Line: 10
+
+// Attention: Here the compiler complains saying that cannot convert
+implicitly from 'Error0027' to 'int' but
+// should also say that the use of keyword 'this' is out of context
+since it's used outside a constructor, method
+// or property.
+using System;
+
+class Error0027 {
+        int i = this;
+        int x = 0;
+
+        public static void Main () {
+                Console.WriteLine ("The compiler should complain: Error
+CS0027 trying to use 'this' outside context.");
+                Console.WriteLine ("Trying to assign i to 'this' outside
+a method, property or ctr.");
+        }
+}
+
+
+
+
+
+
+
+
+
+
+Setting qa contact to the default for this product.
+   This bug either had no qa contact or an invalid one.
+
+