Bug 319902 (MONO77099) - [PARSER] Parser/tokenizer error/ambiguity
Summary: [PARSER] Parser/tokenizer error/ambiguity
Status: RESOLVED FIXED
Alias: MONO77099
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Marek Safar
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-27 16:00 UTC by Peter Sestoft
Modified: 2008-07-10 11:26 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:42:36 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".

Comment 2 Marek Safar 2008-07-10 11:26:08 UTC
Fixed in SVN.