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

Small cleanup in hot path of NameResolution #1211

Merged
merged 5 commits into from
May 25, 2016
Merged

Conversation

forki
Copy link
Contributor

@forki forki commented May 21, 2016

No description provided.

DepthCheck ndeep m ++ (fun () ->
match ty1 with
| TType_var r | TType_measure (MeasureVar r) ->
// The types may still be equivalent due to abbreviations, which we are trying not to eliminate
if typeEquiv csenv.g ty1 ty then CompleteD else

// The famous 'occursCheck' check to catch things like 'a = list<'a>
if occursCheck csenv.g r ty then ErrorD (ConstraintSolverInfiniteTypes(denv,ty1,ty,m,m2)) else
if occursCheck csenv.g r ty then ErrorD (ConstraintSolverInfiniteTypes(csenv.DisplayEnv,ty1,ty,m,m2)) else
Copy link
Contributor

Choose a reason for hiding this comment

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

We may reindent and space the tuple

if occursCheck csenv.g r ty then
    ErrorD (ConstraintSolverInfiniteTypes(csenv.DisplayEnv, ty1, ty, m, m2))
else
// keep same indentation there, that fun () is huge

or at least keep the else on the next line

@dsyme what is up with style of spacing in tuples? I've seen some fortran codebase where those won't have any spaces between each argument in the list, I think it reads better with spacing but not sure what you prefer for the compiler codebase.

Copy link
Contributor

Choose a reason for hiding this comment

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

Space-after-comma is preferred. But as per my comment on another thread, that would go in a separate cleanup PR.

@dsyme
Copy link
Contributor

dsyme commented May 21, 2016

This all looks good - added some comments above.

@KevinRansom
Copy link
Member

@forki
Thank you for taking care of this cleanup.

Kevin

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.

5 participants