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

Bring back decl engine optimisation for already concrete decls #6554

Open
xunilrj opened this issue Sep 16, 2024 · 0 comments
Open

Bring back decl engine optimisation for already concrete decls #6554

xunilrj opened this issue Sep 16, 2024 · 0 comments
Assignees

Comments

@xunilrj
Copy link
Contributor

xunilrj commented Sep 16, 2024

Bring back the optimization removed by #6532.

if type_mapping.source_ids_contains_concrete_type(ctx.engines)
            || !decl_engine.get(&self.id).is_concrete(ctx.engines)
        {
            let mut decl = (*decl_engine.get(&self.id)).clone();
            if decl.subst(type_mapping, ctx).has_changes() {
                Some(
                    decl_engine
                        .insert(decl, decl_engine.get_parsed_decl_id(&self.id).as_ref())
                        .with_parent(decl_engine, self.id.into()),
                )
            } else {
                None
            }

The problem seems to be is_concrete is not working 100% for functions/methods with generics, because parent´s generics are not inserted into the function/method type parameters Vec.

@xunilrj xunilrj self-assigned this Sep 16, 2024
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