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

Can't define enums in sub-packages #1903

Closed
alecthomas opened this issue Jun 28, 2024 · 3 comments
Closed

Can't define enums in sub-packages #1903

alecthomas opened this issue Jun 28, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@alecthomas
Copy link
Collaborator

alecthomas commented Jun 28, 2024

I thought this was working, but it doesn't seem to be in practice.

We should also ensure that all types can be defined in sub-packages.

@alecthomas alecthomas added bug Something isn't working next Work that will be be picked up next labels Jun 28, 2024
@github-actions github-actions bot added triage Issue needs triaging and removed triage Issue needs triaging labels Jun 28, 2024
@ftl-robot ftl-robot mentioned this issue Jun 28, 2024
@deniseli
Copy link
Contributor

deniseli commented Jun 28, 2024

Is this the same issue rooted in the fact that enums haven't been migrated to the new extractor yet?

@alecthomas
Copy link
Collaborator Author

Related, yes.

@github-actions github-actions bot removed the next Work that will be be picked up next label Jun 28, 2024
deniseli added a commit that referenced this issue Jul 2, 2024
…ding in unit tests (#1909)

Fixes #1577

This change introduces a new generated file `types.ftl.go` in the
user-defined package itself to make sure sumtype registrations get
called when running unit tests.

Notes:
* This change also includes a subpackage `subpackage` in the test data
that is not yet unit tested. Unit tests should be added (identical to
the parent package's unit tests) after
#1903 is resolved. Some work
will also need to be done to extend the `types.ftl.go` generation to
working on subpackages.
* This works by extending the existing logic operating on
`mainModuleContext`, which means that code now generates not only just
the literal `main` package, but also the conceptual _main_ package's
additional artifacts. I couldn't come up with a name that would be
better, so it's left as-is in this PR, but please let me know if you
think of something better.
worstell added a commit that referenced this issue Jul 11, 2024
worstell added a commit that referenced this issue Jul 11, 2024
@worstell
Copy link
Contributor

#2050

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

No branches or pull requests

3 participants