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

Bogus(?) Error when `is required` an attribute of CStruct repr #1993

Open
zoffixznet opened this issue Jun 29, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@zoffixznet
Copy link
Contributor

commented Jun 29, 2018

If you mark an attribute as is required on a class with CStruct repr, then you get an error about CStruct representation attribute. Is that an accurate error? Sounds like it's saying an attribute with CStruct repr isn't supported, which isn't what the code is trying to use:

$ perl6 -e 'use NativeCall; class B is repr("CStruct") { has uint32 $.b } ; B.new(:1b)'


$ perl6 -e 'use NativeCall; class B is repr("CStruct") { has uint32 $.b is required} ; B.new(:1b)'
CStruct representation attribute not yet fully implemented
  in submethod BUILDALL at -e line 1
  in block <unit> at -e line 1

This is Rakudo version 2018.05-54-g148d7c5 built on MoarVM version 2018.05-57-g89dee3b
implementing Perl 6.c.

Looks like it comes from here, but I'm unsure if the error should be changed to say the trait is not supported or if there is actually a way to check if an attribute has been initialized and that should be implemented instead of throwing an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.