// Type Checking Test Case

// Define constants and variables

// Function definitions
fun add(a: int64, b: int64) -> int64 {
    return a + b; // Valid addition of int64
}

fun negate(a: uint64) -> uint64 {
    // Attempt to negate a uint64 - this should fail type checking
    return -a; // Invalid: uint64 cannot be negated
}

fun test_consts() -> int64 {
    const a: int64 = 10; // Constant int64
    // Attempt to mutate a const - this should fail type checking
    a = 15.0; // Invalid: 'a' is a constant
    return a;
}

// If-else block with type checking
fun conditional_check(a: int64) -> bool {
    if a > 10 {
        return true;
    } else {
        return false;
    }
}

// While loop with type checking
fun sum_until(limit: int64) -> int64 {
    let sum: int64 = 0;
    let counter: int64 = 0;

    while counter < limit {
        sum = add(sum, counter); // Valid addition
        counter = counter + 1; // Increment counter
    }

    return sum;
}

fun add_i_f(a: int64, b: float64) -> int64 {
    return a + b; // Invalid: int64 + f64
}

// Main function for testing
fun main() -> int64 {
    let valid_sum: int64 = add(10, 20); // Valid function call

    let invalid_negate: uint64 = negate(5); // This should trigger a type-checking error

    let const_mutation: int64 = test_consts(); // This should trigger a type-checking error

    let result: bool = conditional_check(15); // Valid conditional check

    let total: int64 = sum_until(10); // Valid while loop execution

    //let add_i_f: int64 = add_i_f(10, 5.0); // This should trigger a type-checking error

    return total;
}