aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2025-02-20 11:12:59 +0000
committergingerBill <bill@gingerbill.org>2025-02-20 11:12:59 +0000
commit0ab323012e4fd0303a7e41587a5919c9be028561 (patch)
tree7bbfad729e19919340c23499bc69f99fe2cf22f6 /src/check_stmt.cpp
parent0946f6b48bf829deea145f751a1beb6d7967cd58 (diff)
Use `TypeSet` instead of `PtrSet<Type *>`
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp
index 1708f7c81..e81996566 100644
--- a/src/check_stmt.cpp
+++ b/src/check_stmt.cpp
@@ -1446,8 +1446,8 @@ gb_internal void check_type_switch_stmt(CheckerContext *ctx, Ast *node, u32 mod_
Ast *nil_seen = nullptr;
- PtrSet<Type *> seen = {};
- defer (ptr_set_destroy(&seen));
+ TypeSet seen = {};
+ defer (type_set_destroy(&seen));
for (Ast *stmt : bs->stmts) {
if (stmt->kind != Ast_CaseClause) {
@@ -1515,7 +1515,7 @@ gb_internal void check_type_switch_stmt(CheckerContext *ctx, Ast *node, u32 mod_
GB_PANIC("Unknown type to type switch statement");
}
- if (type_ptr_set_update(&seen, y.type)) {
+ if (type_set_update(&seen, y.type)) {
TokenPos pos = cc->token.pos;
gbString expr_str = expr_to_string(y.expr);
error(y.expr,
@@ -1569,7 +1569,7 @@ gb_internal void check_type_switch_stmt(CheckerContext *ctx, Ast *node, u32 mod_
auto unhandled = array_make<Type *>(temporary_allocator(), 0, variants.count);
for (Type *t : variants) {
- if (!type_ptr_set_exists(&seen, t)) {
+ if (!type_set_exists(&seen, t)) {
array_add(&unhandled, t);
}
}