[Mono-bugs] [Bug 52183][Wis] New - MCS gives incorrect error num for `public void static Main ()'

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 8 Jan 2004 16:44:26 -0500 (EST)


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 miguel@ximian.com.

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

--- shadow/52183	2004-01-08 16:44:26.000000000 -0500
+++ shadow/52183.tmp.28893	2004-01-08 16:44:26.000000000 -0500
@@ -0,0 +1,97 @@
+Bug#: 52183
+Product: Mono/Compilers
+Version: unspecified
+OS: unknown
+OS Details: Mandrake 9.1
+Status: RESOLVED   
+Resolution: FIXED
+Severity: 001 One hour
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: cornel@profsys.iasi.rdsnet.ro               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: MCS gives incorrect error num for `public void static Main ()'
+
+Please fill in this template when reporting a bug, unless you know what you are 
+doing. 
+ 
+Description of Problem: 
+ 
+Doesn't compile a program (incorrect written) - that's good, but doesn't give any 
+message about what is wrong with my code, or any message at all about my code. 
+Instead it tells me that the parser is wrong. 
+ 
+ 
+Steps to reproduce the problem: 
+1. Compile this program (mcs test.cs) 
+ 
+using System; 
+ 
+class t 
+{ 
+        public void static Main (string[] args) 
+        { 
+                Console.WriteLine("Hello"); 
+        } 
+} 
+ 
+Actual Results: 
+Errors at compile time: 
+ 
+[root@cornel mono]# mcs test.cs 
+syntax error, expecting OPERATOR THIS OPEN_BRACKET STAR IDENTIFIER 
+Mono.CSharp.yyParser.yyException: irrecoverable syntax error 
+in <0x00865> Mono.CSharp.CSharpParser:yyparse 
+(Mono.CSharp.yyParser.yyInput) 
+in <0x00079> Mono.CSharp.CSharpParser:parse () 
+ 
+test.cs(5) error CS8025: Parsing error 
+Compilation failed: 1 error(s), 0 warnings 
+[root@cornel mono]# 
+ 
+ 
+ 
+Expected Results: 
+A message telling that the Main() method signature is wrong. 
+ 
+ 
+How often does this happen?  
+Always 
+ 
+Additional Information:
+
+------- Additional Comments From duncan@ximian.com  2003-12-15 13:38 -------
+That's because the signature for Main should be:
+
+public static void Main (string [] args)
+
+Note that the static modifier is declared before the return type (void).
+
+Marking this as NOTABUG.
+
+For more info see: 
+
+http://www.csharphelp.com/archives/archive273.html
+
+------- Additional Comments From cornel@profsys.iasi.rdsnet.ro  2003-12-16 02:58 -------
+i know the signature of main is not correct (i said that in Expected result 
+section), and i know how it should be. 
+I reported as a bug because the compiler doesn't detect WHAT is wrong with 
+my code, detect that SOMETHING is wrong. 
+
+------- Additional Comments From bmaurer@users.sf.net  2003-12-16 13:02 -------
+Cornel is correct, this is a bug. We are emitting an incorrect error 
+number. As well, the message is not user friendly.
+
+However, I am making the priority Wishlist, because the behavior is 
+pretty minor.
+
+You don't happen to have the exact error number that CSC gives, do 
+you?
+
+------- Additional Comments From miguel@ximian.com  2004-01-08 16:44 -------
+Fixed, but I rather not see parsing improvements filed as bugs.