Yeah, and maybe mono should issue a best practice compiler warning too... -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marek Safar Sent: Wednesday, August 13, 2008 12:00 PM To: Aaron Colwell Cc: mono-devel-list@lists.ximian.com Subject: Re: [Mono-dev] Unexpected compiler errors when using "as" keyword
Hello Aaron, > > I've been trying to port some C# code to mono and encountered a > difference with how gmcs & Visual Studio handle the "as" keyword. The > code below is a simple repro case that demonstrates the problem. > > using System; > > namespace AsStringProblem > { > class MainClass > { > public static void Main(string[] args) > { > object o = "Hello World"; > Console.WriteLine(o as string + "blah"); // A. Error in Mono > Console.WriteLine((o as string) + "blah"); // B. Ok > Console.WriteLine("blah" + o as string); // C. Ok > > } > } > } > Please report this as a compiler bug. http://www.mono-project.com/Bugs Thanks Marek _______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list _______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list