You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Anthony Molinaro (Commented) (JIRA)" <ji...@apache.org> on 2012/03/05 19:01:58 UTC

[jira] [Commented] (THRIFT-1475) Incomplete records generation for Erlang

    [ https://issues.apache.org/jira/browse/THRIFT-1475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13222476#comment-13222476 ] 

Anthony Molinaro commented on THRIFT-1475:
------------------------------------------

I'm not clear how things are broken, do you have an example .thrift file and an example of how running it with the dialyzer fails?

I tried
{code}
struct StructA
{
  1: string a;
  2: binary b;
  3: optional string c;
  4: optional binary d;
  5: required string e;
  6: required binary f;
  7: string g = "foo";
}
{code}
Which generates
{code}
-record(structA, {a = undefined :: string(),
                  b = undefined :: string(),
                  c = undefined :: string(),
                  d = undefined :: string(),
                  e = undefined :: string(),
                  f = undefined :: string(),
                  g = "foo" :: string()}).
{code}
Which arguably is not quite correct, but doesn't cause the dialyzer to fail with an error, so I'm not sure what the issue your patch fixes is.  Can you include some information on how to reproduce and test this?

Also, I'm wondering if the type signatures might cause issues in a server.  Right not when a server gets a record which fields which are "strings" the fields actually come in as binaries (assumably as an optimization as you might not need them as "strings", so dialyzer might complain about that, not sure).
                
> Incomplete records generation for Erlang
> ----------------------------------------
>
>                 Key: THRIFT-1475
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1475
>             Project: Thrift
>          Issue Type: Bug
>          Components: Erlang - Compiler
>         Environment: Gentoo GNU/Linux, Erlang OTP R15B
>            Reporter: Max Treskin
>            Assignee: Anthony Molinaro
>            Priority: Minor
>              Labels: dialyzer, erlang
>         Attachments: THRIFT-1475_incomplete_erlang_records.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Thrift compiler for erlang generates incomplete records. It uses erlang string() type for thrift type binary(), and also has not sense to optional values when generates record fields types. Erlang Dialyzer prints warnings on these records so it should be fixed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira