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

What makes unit be too late? #2020

Open
zoffixznet opened this issue Jul 4, 2018 · 3 comments
Open

What makes unit be too late? #2020

zoffixznet opened this issue Jul 4, 2018 · 3 comments
Labels
consensus needed Needs a well-versed decision with justification, possibly from a core developer

Comments

@zoffixznet
Copy link
Contributor

zoffixznet commented Jul 4, 2018

I know you can stick sub EXPORT {...} before unit foo declaration, however, looks like you can stick any number of subs before unit as well:

16:24 | Zoffix | m: sub foo {}; unit class Bar;
16:24 | camelia | rakudo-moar 058addf14: ( no output )

16:24 | Zoffix | m: class foo {}; unit class Bar;

16:24 | camelia | rakudo-moar 058addf14: OUTPUT: «=== SORRY!===   Error while compiling <tmp>␤Too late for unit-scoped class  definition;␤Please use the block form.␤at <tmp>:1␤------> class foo {}; unit class Bar; ⏏ <EOL> ␤»

Is there a logical reason why subs are allowed, but classes/packages/modules are forbidden, or does this need to be tightened up to allow EXPORT sub only?


I filed D#2148 to correct the documentation, and once this Issue is resolved, the result would go in to fix that issue.

@zoffixznet zoffixznet added the consensus needed Needs a well-versed decision with justification, possibly from a core developer label Jul 4, 2018
@JJ
Copy link
Collaborator

JJ commented Jul 21, 2019

Should we move this to the problem-solving repo?

@2colours
Copy link
Contributor

2colours commented Jan 3, 2023

@JJ almost 4 years later... in the name of "forgiveness > permission", I would ask you to move it, if you still hold the sufficient permissions.

@JJ
Copy link
Collaborator

JJ commented Jan 3, 2023

Afraid I don't have enough privs in this organization...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus needed Needs a well-versed decision with justification, possibly from a core developer
Projects
None yet
Development

No branches or pull requests

3 participants