-
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
enhancementA request for a new feature or improvement.A request for a new feature or improvement.good first issueIssues that are good for newcomers or first-time contributors.Issues that are good for newcomers or first-time contributors.
Description
Background:
Wave is planning to support the type alias feature, which allows assigning names to existing types.
While chained aliases like type A = B; type B = C; are valid, recursive aliases such as type A = ptr<A>; must be disallowed to prevent infinite loops during type resolution.
This feature is planned but not yet implemented, and this issue addresses a specific validation rule that will be needed once the alias system is added.
Task:
Define logic to detect and reject self-referential type aliases — both direct and indirect.
Example:
type A = ptr<A>; // ❌ invalid
type B = C;
type C = B; // ❌ invalid (indirect recursion)
The compiler should raise an error like:
Error: Recursive type alias detected: 'A' references itself
Expected Behavior:
- Reject recursive type aliases
- Allow valid nested alias chains
- Provide helpful diagnostics
Difficulty:
🟢 Easy – Suitable for contributors with basic understanding of type checking or dependency resolution
Metadata
Metadata
Assignees
Labels
enhancementA request for a new feature or improvement.A request for a new feature or improvement.good first issueIssues that are good for newcomers or first-time contributors.Issues that are good for newcomers or first-time contributors.
Type
Projects
Status
Backlog