-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
Split up typer context #11534
Split up typer context #11534
Conversation
also do some cleanup
# Conflicts: # src/typing/calls.ml
Ultimately, I'd like to see if we can make I'll merge this as-is though because the nature of the diff here makes this impossible to review otherwise. |
because that will totally fix something
Holding back because we've come across a problem in some castledb generated code which we'll hopefully be able to figure out. |
and random cleanup
This reverts commit f35e83c.
# Conflicts: # src/typing/typeload.ml # src/typing/typeloadModule.ml
One of the things I always found difficult to reason about is our
typer
structure. The combination of many mutable fields, a rather subtle cloning mechanism and the delayed nature of the overall typing makes our internal structure brittle and error-prone. This PR doesn't necessarily change that, but at least it lays some groundwork.Instead of having all fields on
typer
directly, we now work with a much smaller structure:The basic idea is this:
ctx.g
.ctx.m
accordinglyctx.c
properlyctx.f
properlyctx.e
is mutated to manage the per-expression state. Unlikectx.f
, this is re-initialized when typing local functions.typer
itself is the current pass, and the current type parameters. I'd like to look into splitting up the latter into type/field type parameters as well because I see no reason to merge these together.There should be no observable changes from this PR, but there probably will be.