[Mono-dev] Conditional("DEBUG")

Greg Young gregoryyoung1 at gmail.com
Fri Feb 28 15:31:06 UTC 2014


Thanks not sure how we missed it on the .net side.


On Fri, Feb 28, 2014 at 4:42 PM, Greg Young <gregoryyoung1 at gmail.com> wrote:

> hmm I will have to check with msbuild I am pretty sure that code was
> compiling in .net
>
>
> On Fri, Feb 28, 2014 at 4:40 PM, Alex Rønne Petersen <alex at alexrp.com>wrote:
>
>> 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
>> >
>>
>
>
>
> --
> Le doute n'est pas une condition agréable, mais la certitude est absurde.
>



-- 
Le doute n'est pas une condition agréable, mais la certitude est absurde.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20140228/f5493bba/attachment.html>


More information about the Mono-devel-list mailing list