Skip to content

Keep type in instruction - #448

Merged
CohenArthur merged 4 commits into
masterfrom
keep-type-in-instruction
Dec 27, 2021
Merged

Keep type in instruction#448
CohenArthur merged 4 commits into
masterfrom
keep-type-in-instruction

Conversation

@CohenArthur

Copy link
Copy Markdown
Member

To allow later passes to access the type of an instruction without needing to perform the typechecking again, cache the type of each instruction in the instruction. This PR adds a lot of mutability which I am not happy with, but makes genericity possible. I have no idea how to do this without mutability or the repetition of a typechecking pass during the generic pass

@CohenArthur
CohenArthur force-pushed the keep-type-in-instruction branch from 4b9422f to a1a4a73 Compare December 26, 2021 18:29
@CohenArthur

Copy link
Copy Markdown
Member Author

Btw, this should also improve the speed of the typechecking pass for declarations (functions, types)

@CohenArthur

Copy link
Copy Markdown
Member Author

I'm also not too happy with the name type_of as it is the wrong way around (instruction.type_of(context) instead of type_of(instruction)), but couldn't come up with anything else. Suggestions welcome :)

@CohenArthur
CohenArthur merged commit c318bee into master Dec 27, 2021
@CohenArthur
CohenArthur deleted the keep-type-in-instruction branch December 27, 2021 22:17
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.

1 participant