From 22a526bb13c3814960041cc9f24433b121588af5 Mon Sep 17 00:00:00 2001 From: KtorZ Date: Tue, 13 Dec 2022 17:32:49 +0100 Subject: [PATCH] Enforce unique top-level names for tests too. This prevents the compiler from crashing later on. Test names should be unique and not clash with function names. --- crates/lang/src/tipo/environment.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/lang/src/tipo/environment.rs b/crates/lang/src/tipo/environment.rs index 4f70deff..d654993b 100644 --- a/crates/lang/src/tipo/environment.rs +++ b/crates/lang/src/tipo/environment.rs @@ -995,6 +995,7 @@ impl<'a> Environment<'a> { } Definition::Test(Function { name, location, .. }) => { + assert_unique_value_name(names, name, location)?; hydrators.insert(name.clone(), Hydrator::new()); let arg_types = vec![]; let return_type = builtins::bool();