mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-15 15:41:26 -07:00
Add #no_type_assert and #type_assert to disable implicit type assertions with x.(T)
This commit is contained in:
@@ -490,6 +490,14 @@ void check_stmt(CheckerContext *ctx, Ast *node, u32 flags) {
|
||||
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;
|
||||
}
|
||||
|
||||
ctx->state_flags = out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user