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.
This commit is contained in:
KtorZ 2022-12-13 17:32:49 +01:00 committed by Lucas
parent 4dfb454d8a
commit 22a526bb13
1 changed files with 1 additions and 0 deletions

View File

@ -995,6 +995,7 @@ impl<'a> Environment<'a> {
} }
Definition::Test(Function { name, location, .. }) => { Definition::Test(Function { name, location, .. }) => {
assert_unique_value_name(names, name, location)?;
hydrators.insert(name.clone(), Hydrator::new()); hydrators.insert(name.clone(), Hydrator::new());
let arg_types = vec![]; let arg_types = vec![];
let return_type = builtins::bool(); let return_type = builtins::bool();