gpt4 book ai didi

java - 节俭的Java : Cannot use reserved language keyword: "alias"

转载 作者:行者123 更新时间:2023-12-05 07:09:52 33 4
gpt4 key购买 nike

我正在尝试使用 Ant 编译 thrift 代码并看到以下错误:

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|Programmer’s Guide to Apache Thrift 的引用

Reserved words

The following lexically sorted list of symbols aren’t part of Thrift IDL syntax but may not be used in Thrift IDL for various reasons, many of which are related to output language conflicts.

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

别名也在列表中

关于java - 节俭的Java : Cannot use reserved language keyword: "alias",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61426090/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com