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

Enables where clauses for traits. #4584

Merged
merged 4 commits into from
May 25, 2023
Merged

Conversation

esdrubal
Copy link
Contributor

@esdrubal esdrubal commented May 24, 2023

Description

With these changes where clauses are enabled for traits. This commit also adds error handling when an impl is created for a generic trait with where clause.

Generic traits are not supported yet on super traits or where clauses, when the support is added we should also perform the bounds check there.

Fixes #4560
Fixes #970

Checklist

  • I have linked to any relevant issues.
  • 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).
  • 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.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@esdrubal esdrubal added enhancement New feature or request language feature Core language features visible to end users P: critical Should be looked at before anything else labels May 24, 2023
@esdrubal esdrubal self-assigned this May 24, 2023
@esdrubal esdrubal force-pushed the esdrubal/4560_traits_where_clauses branch from 4f18e94 to b0aebc4 Compare May 24, 2023 08:40
With these changes where clauses are enabled for traits.
This commit also adds error handling when an `impl` is created for a generic
trait with where clause.

Generic traits are not supported yet on super traits or where clauses,
when the support is added we should also perform the bounds check there.

Fixes #4560
Fixes #970
@esdrubal esdrubal requested a review from a team May 24, 2023 09:17
@esdrubal esdrubal enabled auto-merge (squash) May 24, 2023 11:51
@esdrubal esdrubal merged commit ea9c4f4 into master May 25, 2023
24 checks passed
@esdrubal esdrubal deleted the esdrubal/4560_traits_where_clauses branch May 25, 2023 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request language feature Core language features visible to end users P: critical Should be looked at before anything else
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle where clause for traits Implement trait constraints
3 participants