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

Compiler abort on unit as map key #1234

Closed
simeonmiteff opened this issue Jul 4, 2022 · 1 comment · Fixed by #1256
Closed

Compiler abort on unit as map key #1234

simeonmiteff opened this issue Jul 4, 2022 · 1 comment · Fixed by #1256
Assignees
Labels
Bug Something isn't working

Comments

@simeonmiteff
Copy link

The following program:

module test;

type Key = unit {a: uint8;};

global m: map<Key, uint8>;

m[[$a=1]] = 1;

print m;

...causes spicy to abort with a failed assertion:

$ spicyc -j assert_fails_map_key_types.spicy 
spicyc: /home/simeon/tmp/spicy/hilti/toolchain/src/compiler/codegen/types.cc:673: 
hilti::detail::visitor::Visitor<hilti::detail::codegen::CxxTypes, {anonymous}::VisitorStorage, hilti::Node, 
hilti::detail::visitor::Order::Pre>::result_t {anonymous}::VisitorStorage::operator()(const hilti::type::Struct&, 
hilti::detail::visitor::Visitor<hilti::detail::codegen::CxxTypes, {anonymous}::VisitorStorage, hilti::Node, 
hilti::detail::visitor::Order::Pre>::position_t): Assertion `typeID(p.node)' failed.
Aborted (core dumped)

This may be a duplicate of #1233 (i.e., perhaps this is expected but not checked for by the parser and documented as unsupported).

@rsmmr
Copy link
Member

rsmmr commented Jul 7, 2022

Like #1238, will need some digging what's going on.

@rsmmr rsmmr self-assigned this Aug 9, 2022
rsmmr added a commit that referenced this issue Aug 10, 2022
The struct type's ID could end up not making it across the
Spicy-to-HILTI boundary.

Closes #1234.
@bbannier bbannier linked a pull request Aug 15, 2022 that will close this issue
rsmmr added a commit that referenced this issue Aug 18, 2022
The struct type's ID could end up not making it across the
Spicy-to-HILTI boundary.

Closes #1234.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants