Goal
Complete the validator to support user-defined types (structs, enums, unions), method validation, and proper function scoping.
Current Problems
1. User-defined type validation is disabled
crates/validator/src/lib.rs lines 109-135: validate_user_type(), lookup_variable(), declare_variable(), and the entire validate() method with type-aware scoping are all commented out.
This means:
- No validation of enum definitions
- No validation of struct/union field types
- Function-local variable scoping/lookup is not implemented
NeverChangedMutableVariable and NotUsedVariable checks are disabled
2. Method calls not supported
crates/validator/src/function_call.rs line 55-58:
//BUG: Hələ method çağırışlarını dəstəkləmədiyimiz üçün bu hissə hələ implementasiya edilməyib.
panic!("Burası hələ implementasiya etməmişik...");
Methods on structs, unions, and primitive types cannot be validated.
3. Struct/union definitions not stored
crates/validator/src/helper.rs: The struct/union definition lookup inside get_type() for Expr::StructInit is commented out - returns Type::Any unconditionally.
Goal
Complete the validator to support user-defined types (structs, enums, unions), method validation, and proper function scoping.
Current Problems
1. User-defined type validation is disabled
crates/validator/src/lib.rslines 109-135:validate_user_type(),lookup_variable(),declare_variable(), and the entirevalidate()method with type-aware scoping are all commented out.This means:
NeverChangedMutableVariableandNotUsedVariablechecks are disabled2. Method calls not supported
crates/validator/src/function_call.rsline 55-58:Methods on structs, unions, and primitive types cannot be validated.
3. Struct/union definitions not stored
crates/validator/src/helper.rs: The struct/union definition lookup insideget_type()forExpr::StructInitis commented out - returnsType::Anyunconditionally.