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

Fixed Cycle Detection Logic and Added Tests. #524

Merged

Conversation

InsertCreativityHere
Copy link
Member

This PR does a couple few things:

  • Fixes the logic for detecting cyclic container types (structs and exceptions) because the current logic is totally broken.
    A Slice definition like struct S { s: S } causes a stack overflow. This is no longer the case with these new changes.

  • Fixes the logic for reporting cyclic type aliases. It incorrectly reports cycles like: 'Foo -> B -> A -> B'.
    Even though Foo isn't part of the cycle, it gets reported like it is.

  • Simplifies the error reporting logic for cyclic type aliases. We go out of our way to emit very detailed messages about each link in a cycle. Now we just report the cycle like: 'A -> B -> C -> A'. I think that's good enough, and made it easy to implement the above mentioned fix.

  • Implements Add tests for InfiniteSizeCycle and CannotResolveDueToCycles  #386 and finishes implementing Add Detection/Validation/Tests for Catching Cyclic Type-Aliases #181 by adding tests for cycle detection of both type-aliases and containers.

Copy link
Member

@externl externl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

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.

None yet

2 participants