From b048b9987b6ec9ce9e7ec38fc076b0836bcf98d5 Mon Sep 17 00:00:00 2001 From: Ralf Anton Beier Date: Sun, 22 Mar 2026 16:09:19 +0100 Subject: [PATCH] fix: use resource_definer for graph override instead of is_reexporter Replace is_reexporter (broken for cross-name re-exports) with a check that the graph knows about this resource and says the callee is NOT the definer. Uses defines_resource combined with resource_definer().is_some() as a knowledge guard. Co-Authored-By: Claude Opus 4.6 (1M context) --- meld-core/src/resolver.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/meld-core/src/resolver.rs b/meld-core/src/resolver.rs index 977f926..0e093ec 100644 --- a/meld-core/src/resolver.rs +++ b/meld-core/src/resolver.rs @@ -2113,8 +2113,12 @@ impl Resolver { .unwrap_or(&op.import_field); if rg.defines_resource(*to_comp, iface, rn) { op.callee_defines_resource = true; - } else if rg.is_reexporter(*to_comp, iface, rn) + } else if rg + .resource_definer(iface, rn) + .is_some() { + // Graph knows about this resource and says + // this component is NOT the definer. op.callee_defines_resource = false; } } @@ -2125,7 +2129,9 @@ impl Resolver { .unwrap_or(&op.import_field); if rg.defines_resource(*to_comp, iface, rn) { op.callee_defines_resource = true; - } else if rg.is_reexporter(*to_comp, iface, rn) + } else if rg + .resource_definer(iface, rn) + .is_some() { op.callee_defines_resource = false; } @@ -2324,7 +2330,7 @@ impl Resolver { .unwrap_or(&op.import_field); if rg.defines_resource(*to_comp, iface, rn) { op.callee_defines_resource = true; - } else if rg.is_reexporter(*to_comp, iface, rn) { + } else if rg.resource_definer(iface, rn).is_some() { op.callee_defines_resource = false; } } @@ -2335,7 +2341,7 @@ impl Resolver { .unwrap_or(&op.import_field); if rg.defines_resource(*to_comp, iface, rn) { op.callee_defines_resource = true; - } else if rg.is_reexporter(*to_comp, iface, rn) { + } else if rg.resource_definer(iface, rn).is_some() { op.callee_defines_resource = false; } }