thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Slee <ms...@facebook.com>
Subject RE: const bug
Date Mon, 23 Aug 2010 20:45:55 GMT
I think this one falls under the category of "reasonable, but currently unimplemented feature."
Not sure if there's a JIRA ticket open for this (nothing springs to mind). Worth opening one,
I don't see any reason not to support this.

-----Original Message-----
From: Stephen Haberman [mailto:stephen@exigencecorp.com] 
Sent: Monday, August 23, 2010 1:36 PM
To: thrift-user@incubator.apache.org
Subject: const bug

Hi,

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?

Thanks,
Stephen


Mime
View raw message