Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constant structs do not work. #10

Open
dantswain opened this issue Oct 10, 2016 · 0 comments · May be fixed by #11
Open

Constant structs do not work. #10

dantswain opened this issue Oct 10, 2016 · 0 comments · May be fixed by #11

Comments

@dantswain
Copy link
Owner

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant