Bugzilla – Bug 321656
[PARSER] Improve error message given when non-declaration statements are found at class scope
Last modified: 2008-10-10 10:58:20 UTC
---- Reported by matt@use.net 2006-07-24 16:20:41 MST ---- Steps to reproduce the problem: 1. try to compile attached program using gmcs Actual Results: generics.cs(13,4): error CS8025: Parsing error Expected Results: should compile and run with same results as specified in the book. ---- Additional Comments From matt@use.net 2006-07-24 16:23:15 MST ---- Created an attachment (id=170161) code sample that gets compile error ---- Additional Comments From rharinath@novell.com 2006-07-26 07:05:05 MST ---- The attached code has executable code embedded in class scope. Yep, it would be preferable if the error message was better. ---- Additional Comments From kornelpal@gmail.com 2006-07-26 07:45:55 MST ---- For Matt: This code should not compile at all because it isn't valid C# code. Neither MS CSC 2.0 nor gmcs compiles it. I attached a corrected source file that compiles and behaves as expected. ---- Additional Comments From kornelpal@gmail.com 2006-07-26 07:46:19 MST ---- Created an attachment (id=170162) fixed.cs Imported an attachment (id=170161) Imported an attachment (id=170162) Unknown operating system unknown. Setting to default OS "Other".
Fixed in SVN.