[Mono-dev] Conditional("DEBUG")

Alex Rønne Petersen alex at alexrp.com
Fri Feb 28 14:40:30 UTC 2014


This is expected behavior; the Conditional attribute just says that
calls should be removed if not compiling with the specified
preprocessor symbol. The code is still semantically checked.

On Fri, Feb 28, 2014 at 3:37 PM, Greg Young <gregoryyoung1 at gmail.com> wrote:
>         [Conditional("DEBUG")]
>         public void Enqueued()
>         {
>             Interlocked.Increment(ref _length);
>         }
>
> in Debug build results in:
>
> /opt/mono/lib/mono/4.5/Microsoft.CSharp.targets (CoreCompile target) ->
>
> Bus/QueueStatsCollector.cs(275,39): error CS0103: The name `_length' does
> not exist in the current context
>
>         [Conditional("DEBUG")]
>         public void Enqueued()
>         {
> #if DEBUG
>             Interlocked.Increment(ref _length);
> #endif
>         }
>
> Fixes it but seems a bit wrong.
>
>
>
> --
> Le doute n'est pas une condition agréable, mais la certitude est absurde.
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>


More information about the Mono-devel-list mailing list