You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Bryan Duxbury (JIRA)" <ji...@apache.org> on 2008/12/04 22:22:44 UTC

[jira] Updated: (THRIFT-225) Can't assign some field types a default values

     [ https://issues.apache.org/jira/browse/THRIFT-225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury updated THRIFT-225:
---------------------------------

    Description: 
If you have a struct like

{{{
struct myStruct {
  byte x = 200;
}
}}}

then the generated code for that default value lacks the necessary (byte) cast to avoid a "loss of precision" compiler warning. The same is true for i64 values that are larger than an i32, since java assumes all numeric literals are i32s unless they're explicitly longs.

  was:
If you have a struct like

{{{
struct myStruct {
  byte x = 200;
}
}}}

then the generated code for that default value lacks the necessary (byte) cast to avoid a "loss of precision" compiler warning.

        Summary: Can't assign some field types a default values  (was: Can't assign byte fields a default value)

> Can't assign some field types a default values
> ----------------------------------------------
>
>                 Key: THRIFT-225
>                 URL: https://issues.apache.org/jira/browse/THRIFT-225
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>            Reporter: Bryan Duxbury
>            Priority: Minor
>
> If you have a struct like
> {{{
> struct myStruct {
>   byte x = 200;
> }
> }}}
> then the generated code for that default value lacks the necessary (byte) cast to avoid a "loss of precision" compiler warning. The same is true for i64 values that are larger than an i32, since java assumes all numeric literals are i32s unless they're explicitly longs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.