mirror of
https://github.com/facebook/sapling.git
synced 2024-10-03 21:37:23 +03:00
In preparation for the addition of a compiler check for reserved identifier names in Thrift IDL, add the annotation to allow the use of the reserved identifier names.
Summary: In addition to reserved words, Thrift reserves all identifiers that contain the case-insensitive substring `fbthrift`. Such identifiers require users to explicitly annotate the usage with `thrift.AllowReservedIdentifierName`, and may result in undefined behavior. Implementation notes: In a subsequent change, the Thrift compiler will return an error when it encounters any identifier name that violates the above restriction unless the identifier is annotated with `thrift.AllowReservedIdentifierName`. Reviewed By: praihan Differential Revision: D58202161 fbshipit-source-id: df6033cfe99594041a7be71f2310c80205b65261
This commit is contained in:
parent
b1caca7b05
commit
da492cce6a
@ -249,3 +249,24 @@ enum RpcPriority {
|
||||
struct DeprecatedUnvalidatedAnnotations {
|
||||
1: map<string, string> items;
|
||||
}
|
||||
|
||||
/**
|
||||
* In addition to reserved words, Thrift reserves all identifiers
|
||||
* that contain the case-insensitive substring fbthrift.
|
||||
* The use of such identifiers requires users to explicitly annotate
|
||||
* the usage with `@thrift.AllowReservedIdentifierName`,
|
||||
* and may result in undefined behavior.
|
||||
*/
|
||||
@scope.Const
|
||||
@scope.Enum
|
||||
@scope.EnumValue
|
||||
@scope.Exception
|
||||
@scope.Field
|
||||
@scope.Function
|
||||
@scope.Interaction
|
||||
@scope.Program
|
||||
@scope.Service
|
||||
@scope.Struct
|
||||
@scope.Typedef
|
||||
@scope.Union
|
||||
struct AllowReservedIdentifierName {}
|
||||
|
Loading…
Reference in New Issue
Block a user