unify catch fallback value sources
This commit is contained in:
@@ -3763,14 +3763,16 @@ ct_eval_catch_expr :: proc(state: ^Ct_State, expr: ast.Expr, expected: types.Typ
|
||||
if value.active == 0 {
|
||||
return payload, ct_flow(.Normal), true
|
||||
}
|
||||
if expr.right != ast.INVALID_EXPR {
|
||||
return ct_eval_expr(state, expr.right, success, depth+1)
|
||||
}
|
||||
scope_start := len(state.bindings)
|
||||
if symbol.is_valid(expr.name) && expr.name != checker.sink_symbol && payload != INVALID_CT_VALUE {
|
||||
error_type := types.fallible_error(value.type, &checker.module.types)
|
||||
ct_bind_value(state, expr.name, error_type, payload, false)
|
||||
}
|
||||
if expr.right != ast.INVALID_EXPR {
|
||||
result, result_flow, result_ok := ct_eval_expr(state, expr.right, success, depth+1)
|
||||
ct_pop_bindings(state, scope_start)
|
||||
return result, result_flow, result_ok
|
||||
}
|
||||
handler, handler_ok := ct_exec_statements(state, expr.body, true, depth+1)
|
||||
ct_pop_bindings(state, scope_start)
|
||||
if !handler_ok {
|
||||
|
||||
Reference in New Issue
Block a user