Skip to content

Interface Inheritance Cycles are Never Detected #796

Description

@InsertCreativityHere

Cycle detection (cycle_detection.rs:19) explicitly covers only structs and enums. Interface inheritance has no cycle check, so slicec/src/grammar/elements/interface.rs:52 recurses forever (the diamond-dedup at line 58 runs after the recursion, so it can't break the loop). Reached during validation via validate_inherited_identifiers → all_inherited_operations(). This is a true infinite recursion, not depth-limited — and the trigger is a plausible typo:

Reproduction

module T
interface I : I {}

Mutual (A : B / B : A) and longer cycles do the same. All exit 127.

Fix

Detect interface-inheritance cycles and report a diagnostic (or add a visited-set to all_base_interfaces).

Activity

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

Metadata

Metadata

Labels

slicecRelated to the 'slicec' crate

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions