Skip to content

validator: re-enable user-defined type validation and method call support #21

Description

@Prestgg1

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions