Jelajahi Sumber

Add nullptr check back

jakubtomsu 1 tahun lalu
induk
melakukan
fe268a9dd2
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      src/check_type.cpp

+ 1 - 1
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");