Skip to content

Constant structs do not work. #10

Description

@dantswain

To replicate, add the following to test/thrash_test.thrift:

const SubStruct CONST_SUBSTRUCT = { "sub_id": 9, "sub_name": "number nine" }

This causes an error on compile:

$ THRIFT_INPUT_DIR=test/ mix compile.thrift
thrift -o src --gen erl test/thrash_test.thrift

$ mix test
Compiling 1 file (.erl)
Compiling 11 files (.ex)

== Compilation error on file test/simple_struct.ex ==
** (ErlangError) erlang error: {:undefined_record, :SubStruct}
    (stdlib) :erl_eval.exprs/2
    expanding macro: Thrash.Constants.__using__/1
    test/simple_struct.ex:14: Constants (module)
    (elixir) expanding macro: Kernel.use/1
    test/simple_struct.ex:14: Constants (module)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions