//! > Test error propagation.

//! > test_runner_name
test_function_lowering(expect_diagnostics: false)

//! > function_code
fn foo(a: Result<Result<u128, felt252>, felt252>) -> Result<felt252, felt252> {
    a??;
    Result::<felt252, felt252>::Ok(1)
}

//! > function_name
foo

//! > semantic_diagnostics

//! > lowering_diagnostics

//! > lowering_flat
Parameters: v0: core::result::Result::<core::result::Result::<core::integer::u128, core::felt252>, core::felt252>
blk0 (root):
Statements:
End:
  Match(match_enum(v0) {
    Result::Ok(v1) => blk1,
    Result::Err(v2) => blk4,
  })

blk1:
Statements:
End:
  Match(match_enum(v1) {
    Result::Ok(v3) => blk2,
    Result::Err(v4) => blk3,
  })

blk2:
Statements:
  (v5: core::felt252) <- 1
  (v6: core::result::Result::<core::felt252, core::felt252>) <- Result::Ok(v5)
End:
  Return(v6)

blk3:
Statements:
  (v7: core::result::Result::<core::felt252, core::felt252>) <- Result::Err(v4)
End:
  Return(v7)

blk4:
Statements:
  (v8: core::result::Result::<core::felt252, core::felt252>) <- Result::Err(v2)
End:
  Return(v8)
