Bugzilla – Bug 319902
[PARSER] Parser/tokenizer error/ambiguity
Last modified: 2008-07-10 11:26:08 UTC
---- Reported by sestoft@dina.kvl.dk 2005-12-27 09:00:41 MST ---- Description of Problem: The sample program below does not compile with gmcs 1.1.12.1 for Linux. It should. Steps to reproduce the problem: 1. Compile with gmcs 2. Observe compiler error message. Actual Results: https://bugzilla.novell.com/show_bug.cgi?id=MONO18.cs(13,43): error CS0103: The name `x`2' does not exist in the context of `MyTest' Compilation failed: 1 error(s), 0 warnings Expected Results: Compiles OK. Additional Information: It does compile OK with mcs and csc, and compiles OK with gmcs if fewer arguments are given to Console.WriteLine. Here's the program: using System; class MyTest { public static void Main(String[] args) { int[] ivals = { 2, 5 }; foreach (int x in ivals) foreach (int y in ivals) Console.WriteLine("{0} {1} {2} {3} {4} {5}", x, y, x+y, x-y, x<y, x>=y); } } ---- Additional Comments From miguel@ximian.com 2005-12-30 12:27:51 MST ---- This is another problem in the tokenizer/parser for the generics branch of gmcs. The compiler is getting confused and is parsing x<x,y>=x as x GENERICS_LT IDENTIFIER COMMA IDENTIFIER GENERICS_GT And at that point its busted. Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>debian linux</cf_op_sys_details> Unknown operating system unknown. Setting to default OS "Other".
Fixed in SVN.