You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Nevo Hed (JIRA)" <ji...@apache.org> on 2011/04/06 06:48:05 UTC
[jira] [Updated] (THRIFT-1130) Add the ability to specify symbolic
default value for optional boolean
[ https://issues.apache.org/jira/browse/THRIFT-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nevo Hed updated THRIFT-1130:
-----------------------------
Description:
When specifying a default value for an optional struct member of the type bool the user now needs to enter a numeric value (0, or 1). It would be nice if they could specify a symbolic value such as 'true' & 'false'
{quote}
Example thrift file:
struct AtscStrmRecordRequestT {
1: optional bool bDoSomething = true,
2: required string whatever;
}
{quote}
With current error
{quote}
$ /opt/thrift-0.6.0/compiler/cpp/thrift --gen cpp /rtmp/x.thrift
[ERROR:/rtmp/x.thrift:2] (last token was 'true')
Cannot use reserved language keyword: "true"
{quote}
was:
When specifying a default value for an optional struct member of the type bool the user now needs to enter a numeric value (0, or 1). It would be nice if they could specify a symbolic value such as 'true' & 'false'
Example thrift file:
struct AtscStrmRecordRequestT {
1: optional bool bDoSomething = true,
2: required string whatever;
}
With current error
$ /opt/thrift-0.6.0/compiler/cpp/thrift --gen cpp /rtmp/x.thrift
[ERROR:/rtmp/x.thrift:2] (last token was 'true')
Cannot use reserved language keyword: "true"
Patch Info: [Patch Available]
> Add the ability to specify symbolic default value for optional boolean
> ----------------------------------------------------------------------
>
> Key: THRIFT-1130
> URL: https://issues.apache.org/jira/browse/THRIFT-1130
> Project: Thrift
> Issue Type: Improvement
> Components: Compiler (General)
> Affects Versions: 0.5, 0.6
> Reporter: Nevo Hed
> Priority: Minor
>
> When specifying a default value for an optional struct member of the type bool the user now needs to enter a numeric value (0, or 1). It would be nice if they could specify a symbolic value such as 'true' & 'false'
> {quote}
> Example thrift file:
> struct AtscStrmRecordRequestT {
> 1: optional bool bDoSomething = true,
> 2: required string whatever;
> }
> {quote}
> With current error
> {quote}
> $ /opt/thrift-0.6.0/compiler/cpp/thrift --gen cpp /rtmp/x.thrift
> [ERROR:/rtmp/x.thrift:2] (last token was 'true')
> Cannot use reserved language keyword: "true"
> {quote}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira