From 77989362cab51520d84d3b17bd7a646ab615c909 Mon Sep 17 00:00:00 2001 From: cflmy Date: Wed, 18 Nov 2026 12:36:36 +0800 Subject: [PATCH] fix(sema): bind imported calls to full declaration path for sound transitive proof invalidation --- src/sema/ir.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/sema/ir.rs b/src/sema/ir.rs index 72163b1..61f9e79 100755 --- a/src/sema/ir.rs +++ b/src/sema/ir.rs @@ -913,10 +913,14 @@ fn classify_call( }) else { return CallClass::Other; }; - let decl = if path.len() >= 2 { - path[1..].to_vec() - } else if let Some(d) = declaration_path_of(lib, fun) { + // Resolve the *declaration* path in the imported module, not + // the syntactic call path: `rates.lookup()` may refer to a + // nested `# rates / ## lookup` function. Losing the parent + // would silently break transitive proof invalidation. + let decl = if let Some(d) = declaration_path_of(lib, fun) { d + } else if path.len() >= 2 { + path[1..].to_vec() } else { return CallClass::Other; };