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

Separate resolveType and checking for recursion #408

Merged
merged 3 commits into from
May 13, 2016
Merged

Separate resolveType and checking for recursion #408

merged 3 commits into from
May 13, 2016

Conversation

EliasC
Copy link
Contributor

@EliasC EliasC commented May 11, 2016

This commit refactors resolveType so that the checking for recursive
type synonyms is not done for every lookup. This allows it to be lifted
out of the state monad (which is the main reason for this refactoring).
Instead there is a function resolveTypeAndCheckForLoops that does what
resolveType did before, and this function is called when prechecking a
type synonym. This is done with minimal code duplication by also
refactoring resolving of ref types into its own function.

Also fixes issue #413.

This commit refactors `resolveType` so that the checking for recursive
type synonyms is not done for every lookup. This allows it to be lifted
out of the state monad (which is the main reason for this refactoring).
Instead there is a function `resolveTypeAndCheckForLoops` that does what
`resolveType` did before, and this function is called when prechecking a
type synonym. This is done with minimal code duplication by also
refactoring resolving of ref types into its own function.
@supercooldave
Copy link

Funny, I did something very similar but it looped. Yours doesn't seem to loop. Bravo.
I'll study it more a bit later and accept it.

@PhucVH888
Copy link
Contributor

I have tested with the issue #413 . I works perfectly. Can I merge by 13:00 today if there is not any objection?

@supercooldave supercooldave merged commit d353be1 into parapluu:development May 13, 2016
@supercooldave supercooldave deleted the refactoring/loop-checking branch May 13, 2016 07:58
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.

3 participants