From 239d6d7f61e5b592022109683d5c86ed272dfac8 Mon Sep 17 00:00:00 2001 From: Peefy Date: Tue, 10 May 2022 16:26:45 +0800 Subject: [PATCH] fix: pkgpath prefix replace. --- kclvm/sema/src/resolver/ty.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kclvm/sema/src/resolver/ty.rs b/kclvm/sema/src/resolver/ty.rs index 15298b29c..1a249dc00 100644 --- a/kclvm/sema/src/resolver/ty.rs +++ b/kclvm/sema/src/resolver/ty.rs @@ -19,7 +19,7 @@ fn ty_str_to_pkgpath(ty_str: &str) -> &str { pub fn ty_str_replace_pkgpath(ty_str: &str, pkgpath: &str) -> String { let pkgpath = format!("@{}", pkgpath); if ty_str.contains('.') && ty_str_to_pkgpath(ty_str) == pkgpath { - ty_str.replacen(&pkgpath, "", 1) + ty_str.replacen(&format!("{}.", pkgpath), "", 1) } else { ty_str.to_string() }