[Mono-bugs] [Bug 63485][Nor] New - Partial type is not recognized correctly
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Thu, 19 Aug 2004 12:32:38 -0400 (EDT)
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 atsushi@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=63485
--- shadow/63485 2004-08-19 12:32:38.000000000 -0400
+++ shadow/63485.tmp.9744 2004-08-19 12:32:38.000000000 -0400
@@ -0,0 +1,85 @@
+Bug#: 63485
+Product: Mono: Compilers
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: atsushi@ximian.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Partial type is not recognized correctly
+
+The latest gmcs rejects partial type (supposed to support partial type syntax).
+
+--------
+using System;
+
+public partial class Test
+{
+ public static void Main ()
+ {
+ Console.WriteLine (Foo);
+ }
+}
+
+public partial class Test
+{
+ public static string Foo = "foo";
+}
+
+
+Actual Results:
+
+$ gmcs partial.cs
+ALPHA SOFTWARE: Mono C# Compiler 1.0.0.0 for Generics
+syntax error, got token `CLASS', expecting ABSTRACT AS EXTERN INTERNAL IS
+NEW OVERRIDE PRIVATE PROTECTED PUBLIC READONLY SEALED STATIC THIS UNSAFE
+VIRTUAL VOLATILE WHERE OPEN_BRACE CLOSE_BRACE OPEN_BRACKET CLOSE_BRACKET
+OPEN_PARENS CLOSE_PARENS DOT COMMA COLON SEMICOLON PLUS MINUS ASSIGN OP_LT
+OP_GENERICS_LT OP_GT OP_GENERICS_GT BITWISE_AND BITWISE_OR STAR PERCENT DIV
+CARRET INTERR OP_INC OP_DEC OP_SHIFT_LEFT OP_SHIFT_RIGHT OP_LE OP_GE OP_EQ
+OP_NE OP_AND OP_OR OP_MULT_ASSIGN OP_DIV_ASSIGN OP_MOD_ASSIGN OP_ADD_ASSIGN
+OP_SUB_ASSIGN OP_SHIFT_LEFT_ASSIGN OP_SHIFT_RIGHT_ASSIGN OP_AND_ASSIGN
+OP_XOR_ASSIGN OP_OR_ASSIGN OP_PTR IDENTIFIER
+Mono.CSharp.yyParser.yyException: irrecoverable syntax error
+in <0x00801> Mono.CSharp.CSharpParser:yyparse (Mono.CSharp.yyParser.yyInput)
+in <0x00070> Mono.CSharp.CSharpParser:parse ()
+
+
+Expected Results:
+- compiles fine.
+
+How often does this happen?
+- consistently.
+
+
+Additional Information:
+
+- The example code Martin showed is also rejected as well.
+ http://primates.ximian.com/~martin/blog/entry_123.html
+
+- When I tried mcs, it looks tokenizing fine (resulted in different error
+though).
+
+$ mcs partial.cs
+
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in <0x0001c> Mono.CSharp.TypeContainer:FindMemberWithSameName (string,bool)
+in <0x00054> Mono.CSharp.FieldBase:CheckBase ()
+in <0x00066> Mono.CSharp.Field:Define ()
+in <0x00071> MemberCoreArrayList:DefineContainerMembers ()
+in <0x00213> Mono.CSharp.TypeContainer:DoDefineMembers ()
+in <0x00026> Mono.CSharp.TypeContainer:DefineMembers
+(Mono.CSharp.TypeContainer)
+
+in <0x00247> Mono.CSharp.RootContext:PopulateTypes ()
+in <0x00c4d> Mono.CSharp.Driver:MainDriver (string[])
+in <0x0000f> Mono.CSharp.Driver:Main (string[])