rsdn/nemerle — Issue #134: cs parser report legal statement as compilation error for enum type as default parameter
Author: zyhong
Created: 2011-10-20 03:48:25+00:00
State: open

Class1.cs:

namespace TestCSParser
{
public sealed class RingBuffer
{

public RingBuffer(int size, ClaimStrategyOption claimStrategyOption = ClaimStrategyOption.MultipleProducers, WaitStrategyOption waitStrategyOption = WaitStrategyOption.SpinWait)
{

}
}
}

Class2.cs:

namespace TestCSParser
{

public enum ClaimStrategyOption
{
MultipleProducers,
SingleProducer
}
public enum WaitStrategyOption
{
Blocking,
Yielding,
BusySpin,
SpinWait
}
}

got his compilation error:
...\Class1.cs(7,77): error : Incorrect format of parameter `claimStrategyOption' default value. You should use 'paramName = '

PS: it will work fine if they are in the same file.