aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorjakubtomsu <66876057+jakubtomsu@users.noreply.github.com>2023-11-25 13:29:28 +0100
committerjakubtomsu <66876057+jakubtomsu@users.noreply.github.com>2023-11-25 13:29:28 +0100
commitfe268a9dd29a85d7b7a021cd5a0659a8b8300172 (patch)
treefbc22976e6ddd9d9a5b70ba85d5d2f5dd5378bcd /src/check_type.cpp
parent3c25d93eae4e5aac76c09d7018cf8a440eab700b (diff)
Add nullptr check back
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 33881aa8f..343f0b7bc 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -1510,7 +1510,7 @@ gb_internal Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_para
}
if (default_value != nullptr) {
- if (type_expr->kind == Ast_TypeidType) {
+ if (type_expr != nullptr && type_expr->kind == Ast_TypeidType) {
error(type_expr, "A type parameter may not have a default value");
} else if (is_variadic) {
error(type_expr, "A variadic parameter may not have a default value");