Thrift Java:不能使用保留语言关键字:"alias"



我试图使用Ant编译节俭代码,但看到以下错误:

generate-thrift-chained:
[apply] [ERROR:<path_to_thrift_file>/<thrift_file>.thrift:361] (last token was 'alias')
[apply] Cannot use reserved language keyword: "alias"

如果重要的话,我使用的是Mac OS X版本10.15.4,Thrift 0.9.3,Ant 1.10.7。虽然我知道使用保留关键字会合法地导致这样的问题,但该项目通过了在不同环境Linux Mint 17.3上的编译,该环境具有相同的Thrift版本。

我缺什么了吗?

根据Manning | Apache Thrift程序员指南

保留字

以下按词汇排序的符号列表不属于ThriftIDL语法,但由于各种原因,可能无法在Thrift IDL中使用,许多其中与输出语言冲突有关。

BEGIN, END, __CLASS__, __DIR__, __FILE__, __FUNCTION__, __LINE__, __METHOD__, __NAMESPACE__, abstract, alias, and, args, as, assert, begin, break, case, catch, class, clone, continue, declare, def, default, del, delete, do, dynamic, elif, else, elseif, elsif, end, enddeclare, endfor, endforeach, endif, endswitch, endwhile, ensure, except, exec, finally, float, for, foreach, from, function, global, goto, if, implements, import, in, inline, instanceof, interface, is, lambda, module, native, new, next, nil, not, or, package, pass, print, private, protected, public, raise, redo, rescue, retry, register, return, self, sizeof, static, super, switch, synchronized, then, this, throw, transient, try, undef, unless, unsigned, until, use, var, virtual, volatile, when, while, with, xor, yield

别名也在列表中

最新更新