Skip to content

Conversation

@xunilrj
Copy link
Contributor

@xunilrj xunilrj commented Nov 13, 2025

Description

This PR is continuation of #7483.

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.

Note

Blocks types with const generics in configurables and ABI method args/returns via new TypeId::has_const_generics, and adds tests to enforce errors.

  • Type system:
    • Add TypeId::has_const_generics(engines) to detect const generics in nested types (sway-core/src/type_system/id.rs).
  • Compiler/semantics:
    • Enforce no const generics in configurables via TyConfigurableDecl::forbid_const_generics() and invoke during type check (semantic_analysis/.../configurable.rs, .../declaration.rs).
    • Enforce no const generics in ABI method parameters/returns using TypeId::has_const_generics and remove ad-hoc checker (language/ty/declaration/abi.rs).
  • Tests:
    • Extend should_fail/unsupported_const_generics to cover configurables and ABI cases; update snapshot (test/.../stdout.snap).

Written by Cursor Bugbot for commit eb61590. This will update automatically on new commits. Configure here.

@xunilrj xunilrj self-assigned this Nov 13, 2025
@xunilrj xunilrj requested a review from a team as a code owner November 13, 2025 13:36
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 13, 2025

CodSpeed Performance Report

Merging #7494 will not alter performance

Comparing xunilrj/forbid-const-generics-configurables (eb61590) with master (d7d5099)

Summary

✅ 25 untouched

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants