thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Haberman <>
Subject const bug
Date Mon, 23 Aug 2010 20:36:26 GMT

We're running an old pre-0.3 thrift and trying upgrade, but running into
a compile error. I've reduce it down to this example:

    struct A {
      1: string name = ""
    const A DEFAULT_A = {}
    struct B {
      1: A a = DEFAULT_A

The problem is that with "a = DEFAULT_A", we get this exception:

    type error: const "a" was declared as struct/xception

If I remove "= DEFAULT_A", then it works great.

Just looking at the thrift file, using the DEFAULT_A const as a default
value seems to make sense. Is this a bug, or is it really illegal to use
const structs as default values?


View raw message