From 5450f001740e874bd4982bf5f7e97cb820d2aa1b Mon Sep 17 00:00:00 2001 From: Jeff Date: Sun, 18 Feb 2024 04:57:05 -0500 Subject: [PATCH] Fix validation bug --- src/abstract_tree/for.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/abstract_tree/for.rs b/src/abstract_tree/for.rs index 5d32937..3527bd9 100644 --- a/src/abstract_tree/for.rs +++ b/src/abstract_tree/for.rs @@ -63,6 +63,8 @@ impl AbstractTree for For { } fn validate(&self, _source: &str, context: &Context) -> Result<(), ValidationError> { + self.collection.validate(_source, context)?; + let collection_type = self.collection.expected_type(context)?; let item_type = if let Type::List(item_type) = collection_type { item_type.as_ref().clone() @@ -79,6 +81,7 @@ impl AbstractTree for For { self.context.inherit_all_from(context)?; self.context.set_type(key, item_type)?; + self.item_id.validate(_source, &self.context)?; self.block.validate(_source, &self.context) }