Thriftpy / thriftpy2

Pure python approach of Apache Thrift.
MIT License
567 stars 90 forks source link

Default value with enum must be declared before used #205

Open TommyTT1993 opened 1 year ago

TommyTT1993 commented 1 year ago
struct A {
    1: Type t = Type.AA
}

enum Type {
    AA = 1
    BB = 2
}

And we got error thriftpy2.parser.exc.ThriftParserError: Cann't find name 'Type.AA' at line 2

enum Type {
    AA = 1
    BB = 2
}

struct A {
    1: Type t = Type.AA
}

This will be fine.