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

Incorrect enum constructor triggers dangling node reference error #1584

Open
bbannier opened this issue Nov 2, 2023 · 0 comments
Open

Incorrect enum constructor triggers dangling node reference error #1584

bbannier opened this issue Nov 2, 2023 · 0 comments

Comments

@bbannier
Copy link
Member

bbannier commented Nov 2, 2023

As of b098367 the following incorrect code is not rejected anymore, but instead triggers an exception at compile time:

# file: foo.spicy
module foo;

type C = enum { X, Y, };
global c = C::X(); # There is no constructor for `C::X`, instead should directly use the `C::X` literal.
$ spicyc -dj foo.spicy
libc++abi: terminating due to uncaught exception of type hilti::node_ref::Invalid: dangling node reference
[1]    50453 abort      ./bin/spicyc -dj <..>/foo.spicy

Prior to above commit this was rejected with the following

$ spicyc -dj foo.spicy
[error] <..>/foo.spicy:5:12: ID 'C::X' resolves to something other than just functions
[error] spicyc: aborting after errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant