[Mono-list] Is this a new bug?

Kornél Pál kornelpal at gmail.com
Fri Jul 14 13:34:42 EDT 2006


Hi,

This is a bug in mcs (it produces incorrect IL code). I don't know whether 
it's already reported.

If you don't find any matching bug report, please report the bug at 
http://bugzilla.ximian.com/

Kornél

----- Original Message ----- 
From: "Nikki Locke" <nikki at trumphurst.com>
To: <mono-list at lists.ximian.com>
Sent: Friday, July 14, 2006 7:00 PM
Subject: [Mono-list] Is this a new bug?


> using System;
>
> namespace SpecSoft.Lib {
>
>  public class Test {
>
>    public static void Main() {
>      string model = "TSP100";
>
>      System.Console.WriteLine("switch on '{0}'", model);
>
>      switch(model) {
>        case "wibble":
>        case null:
>          System.Console.WriteLine("case null !!!!");
>          break;
>        case "TSP100":
>          System.Console.WriteLine("case TSP100");
>          break;
>      }
>    }
>
>  }
> }
>
> [nikki at router Test]$ mcs Test.cs
> [nikki at router Test]$ mono Test.exe
> switch on 'TSP100'
> case null !!!!
>
> Reordering the first two cases to
>
> using System;
>
> namespace SpecSoft.Lib {
>
>  public class Test {
>
>    public static void Main() {
>      string model = "TSP100";
>
>      System.Console.WriteLine("switch on '{0}'", model);
>
>      switch(model) {
>        case null:
>        case "wibble":
>          System.Console.WriteLine("case null !!!!");
>          break;
>        case "TSP100":
>          System.Console.WriteLine("case TSP100");
>          break;
>      }
>    }
>
>  }
> }
>
> Gives the correct output:
>
> [nikki at router Test]$ mcs Test.cs
> [nikki at router Test]$ mono Test.exe
> switch on 'TSP100'
> case TSP100
>
> Using mono 1.1.15 on CentOS 4 Linux.
>
> The same code, compiled using MS C#, but run under Mono, gives the correct
> output.
>
> Posted as bug 78860, as I couldn't find anything similar.
>
> -- 
> Nikki Locke, Trumphurst Ltd.      PC & Unix consultancy & programming
> http://www.trumphurst.com/
>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list 



More information about the Mono-list mailing list