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

Refactor monomorphization to use copy_descendants #1951

Open
acl-cqc opened this issue Mar 5, 2025 · 1 comment
Open

Refactor monomorphization to use copy_descendants #1951

acl-cqc opened this issue Mar 5, 2025 · 1 comment

Comments

@acl-cqc
Copy link
Contributor

acl-cqc commented Mar 5, 2025

The new copy_descendants function does much of the hard work copying+substituting nodes in the monomorphization pass. We should simplify the latter to just copy-descendants and then scan for Calls that need further monomorphization.

@acl-cqc
Copy link
Contributor Author

acl-cqc commented Mar 10, 2025

Note, it might be worth refactoring substitution (the Substitution class and (Type/TypeArg)::subst) to act mutably upon an instance, rather than taking a reference and returning a new instance, first.

That is, add a new fn subst_mut(&mut self, &Substitution) alongside the existing fn subst(&self, s: &Substitution) -> Self EDIT: no need, copy_descendants takes an Option<Substitution>

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

No branches or pull requests

1 participant