C# Unity can't cast integer represented enum value.
authorShuhei Tanuma <chobieee@gmail.com>
Thu, 5 Nov 2015 22:47:39 +0000 (07:47 +0900)
committerShuhei Taunma <chobieee@gmail.com>
Tue, 17 Nov 2015 09:02:59 +0000 (18:02 +0900)
commit37e28d98ea1ef178e32be6acc0c5911a616ba021
treee461c92c913ea4658138d482948c796bfd2e2a40
parent097797bf9fe7913b503be8b9a455177cefd44b46
C# Unity can't cast integer represented enum value.

```
namespace MyGame;

enum CommandType : byte {
None = 0,
}

table Command {
id:int;
type:CommandType;
}
```

then generate c# files. it'll output compile error like these.

```
Assets/MyGame/Command.cs(18,39): error CS1041: Identifier expected
Assets/MyGame/Command.cs(18,39): error CS1737: Optional parameter cannot precede required parameters

16:   public static Offset<Command> CreateCommand(FlatBufferBuilder builder,
17:   int id = 0,
18:   CommandType type = (CommandType)0) {
```
src/idl_gen_general.cpp
tests/MyGame/Example/TestSimpleTableWithEnum.cs