mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-16 02:42:22 -07:00
Add #no_type_assert and #type_assert to disable implicit type assertions with x.(T)
This commit is contained in:
@@ -6883,6 +6883,14 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type
|
||||
out &= ~StateFlag_no_bounds_check;
|
||||
}
|
||||
|
||||
if (in & StateFlag_no_type_assert) {
|
||||
out |= StateFlag_no_type_assert;
|
||||
out &= ~StateFlag_type_assert;
|
||||
} else if (in & StateFlag_type_assert) {
|
||||
out |= StateFlag_type_assert;
|
||||
out &= ~StateFlag_no_type_assert;
|
||||
}
|
||||
|
||||
c->state_flags = out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user