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

Const Generics #6860

Open
10 tasks
xunilrj opened this issue Jan 24, 2025 · 0 comments
Open
10 tasks

Const Generics #6860

xunilrj opened this issue Jan 24, 2025 · 0 comments
Assignees
Labels
compiler General compiler. Should eventually become more specific as the issue is triaged epic An epic is a high-level master issue for large pieces of work. language feature Core language features visible to end users tracking-issue Tracking issue for experimental Sway features

Comments

@xunilrj
Copy link
Contributor

xunilrj commented Jan 24, 2025

This PR is the tracking-issue for the const_generics feature.
For more details go to: FuelLabs/sway-rfcs#42

@xunilrj xunilrj self-assigned this Jan 24, 2025
tritao pushed a commit that referenced this issue Feb 11, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…6901)

## Description

This PR is part of #6860.
In future PRs, we will need a way to declare array lengths that are not
literals.

This PR enables this by postponing the length resolution to the
`type-check` phase.

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: Joshua Batty <[email protected]>
@xunilrj xunilrj added compiler General compiler. Should eventually become more specific as the issue is triaged language feature Core language features visible to end users epic An epic is a high-level master issue for large pieces of work. tracking-issue Tracking issue for experimental Sway features labels Feb 13, 2025
IGI-111 added a commit that referenced this issue Feb 17, 2025
## Description

This PR is part of #6860, and it
is officially introducing the `const_generic` feature toggle.

For the moment, it is parsing syntax such as `const N: u64` and it is
returning an error explaining that the feature is off; on the other
hand, it is also returning an error saying that const generics are still
not supported in impl traits when the feature is on. Future PRs will
replicate this error in all possible places.

Nothing else is implemented and it is reserved for future PRs.

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: IGI-111 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler General compiler. Should eventually become more specific as the issue is triaged epic An epic is a high-level master issue for large pieces of work. language feature Core language features visible to end users tracking-issue Tracking issue for experimental Sway features
Projects
None yet
Development

No branches or pull requests

1 participant