cairo-lang-semantic 2.18.0

Cairo semantic model.
Documentation
//! > Test free function param redefinition.

//! > test_runner_name
test_function_diagnostics(expect_diagnostics: true)

//! > function_code
fn foo(a: bool, a: felt252) {}

//! > function_name
foo

//! > expected_diagnostics
error[E2054]: Redefinition of parameter name "a" in function "foo".
 --> lib.cairo:1:17
fn foo(a: bool, a: felt252) {}
                ^^^^^^^^^^

//! > ==========================================================================

//! > Test valid free function with implicit params.

//! > test_runner_name
test_function_diagnostics(expect_diagnostics: false)

//! > function_code
fn foo(a: bool) implicits(felt252, bool) {}

//! > function_name
foo

//! > expected_diagnostics

//! > ==========================================================================

//! > Test uninferred const generic param.

//! > test_runner_name
test_function_diagnostics(expect_diagnostics: true)

//! > function_code
fn foo(a: bool) {
    bar(a)
}

//! > function_name
foo

//! > module_code
fn bar<const n: u16>(a: bool) {}

//! > expected_diagnostics
error[E2310]: Failed to infer constant.
 --> lib.cairo:3:5
    bar(a)
    ^^^