在编译thrift文件的时候发现报了如下的错误
1 | Cannot use reserved language keyword: "class" |
后来查了一下,发现class是thrift的关键字之一,变量起名的时候不能和关键字重复
thrift的全部关键字可以查看thrift的源码
1 | https://github.com/apache/thrift/blob/master/compiler/cpp/src/thrift/generate/t_py_generator.cc |
搜索keywords,下面这些都是thrift关键字,在起名的时候需要注意

以及
1 | https://github.com/apache/thrift/tree/master/compiler/cpp/src/thrift/generate/t_generator.cc |
关键字
