[Mono-list] ConditonalAttribute bug

Sebastien Lambla Sebastien.Lambla@CUBIKS.COM
Thu, 11 Sep 2003 16:35:29 +0100


Hi,

There's a bug in the Microsoft documentation which leaked in mono source code.

In ConditionalAttribute.cs,

[AttributeUsage(AttributeTargets.Method)]

Should be

[AttributeUsage(AttributeTargets.Method,AllowMultiple=true)]

To reproduce the case, just try to compile the following:

#define DEBUG
#define TRACE
public class Test
{
	public static void Main(string args[])
	{
		WriteMe();
	}
	
	[Conditional("DEBUG"),Conditional("TRACE")]
	public static void WriteMe()
	{
		Console.WriteLine("This is me");
	}
}

The compiler is allowed to ignore the attribute, but at least it should compile it :)

PS: I'm no longer subscribed to the list. If you  need me, write on my corp email.

Sebastien Lambla