Module type_system

Source

Functions§

check_mixed_arithmetic_operation
Checks if mixed-type arithmetic operations are allowed, particularly handling unspecified literals that can be coerced to match the other operand’s type. Handles the following cases:
check_unspecified_float_for_type
Checks if an unspecified float literal is in the valid range for a target type. This is used when coercing a float literal to a specific floating-point type.
check_unspecified_int_for_type
Checks if an unspecified integer literal is in the valid range for a target type. This is used when coercing an integer literal to a specific integer type.
determine_let_statement_type
Determines the final type of a variable in a let statement based on both the declared type (if any) and the initialization expression’s type. Handles type inference and coercion of unspecified literals.
finalize_inferred_type
Converts unspecified literal types to concrete types. This is used to assign a default concrete type when an unspecified literal is used in a context where the type wasn’t explicitly given.
handle_unspecified_float_assignment
Handles assignment of an unspecified float literal to a variable with a declared type.
handle_unspecified_int_assignment
Handles assignment of an unspecified integer literal to a variable with a declared type.
is_float_type
Checks if a type is a float type
is_integer_type
Checks if a type is an integer type
is_unsigned_type
Checks if a type is an unsigned integer type