msoucy / dproto

D Protocol Buffer mixins to create structures at compile time
Boost Software License 1.0
37 stars 16 forks source link

Default value error on optional field #22

Closed cschram closed 9 years ago

cschram commented 9 years ago

If you try and set a default value on an optional field, the compiler spits out an error:

mixin ProtocolBufferFromString!"
    message TestMessage {
        optional string foo = 1 [default = \"\"];
    }
";
../../../.dub/packages/dproto-1.1.0/import/dproto/dproto.d-mixin-41(44): Error: RealType.init is used as a type
../../../.dub/packages/dproto-1.1.0/import/dproto/dproto.d-mixin-41(44):        while looking for match for OptionalBuffer!(1, "string", string, false)
msoucy commented 9 years ago

Indeed it does! I'm taking a look at it now, I'm pretty sure I know what's up. Thanks!

msoucy commented 9 years ago

It seems to have specifically been an issue with default values for strings - please verify that those changes fixed it?

cschram commented 9 years ago

Yep, that fixed. :+1:

msoucy commented 9 years ago

Glad to hear it! I just tagged version 1.1.1, so you should be able to use that.