-
Notifications
You must be signed in to change notification settings - Fork 789
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
Conversation
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
This all looks good - added some comments above. |
@forki Kevin |
No description provided.