refactor how impl self type vs iface type is stored (at least for classes) #2434
Labels
A-type-system
Area: Type system
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
Milestone
Near as I can tell, this is how things stand now:
But this is where things go off the rails.
(This is based on the "impl_id" that is stored in resolve.)
The idea of encapsulating an iface+impl pair into an iface-ref seems to make sense, but we probably want to either use separate tables to store the self type (i.e., not the tcache) or else use a separate id. Right now classes end up with different types in the tcache table and node_types table under the same ID. This seems unusual and I think it is the only place that it occurs.
Also, impls + classes should be as similar as possible. I think this was the original idea of introducing iface-ref, but there still seem to be some significant differences in how things work between the two. So we should erase that.
The text was updated successfully, but these errors were encountered: