[Mono-bugs] [Bug 52183][Wis] New - MCS gives incorrect error num for `public void static Main ()'
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 email@example.com.
--- 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 @@
+OS Details: Mandrake 9.1
+Severity: 001 One hour
+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
+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)
+ public void static Main (string args)
+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
+in <0x00079> Mono.CSharp.CSharpParser:parse ()
+test.cs(5) error CS8025: Parsing error
+Compilation failed: 1 error(s), 0 warnings
+A message telling that the Main() method signature is wrong.
+How often does this happen?
+------- Additional Comments From firstname.lastname@example.org 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:
+------- Additional Comments From email@example.com 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 firstname.lastname@example.org 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
+You don't happen to have the exact error number that CSC gives, do
+------- Additional Comments From email@example.com 2004-01-08 16:44 -------
+Fixed, but I rather not see parsing improvements filed as bugs.