瀏覽代碼

Add check for a procedure

gingerBill 1 年之前
父節點
當前提交
8f4ab3c07d
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/check_type.cpp

+ 4 - 1
src/check_type.cpp

@@ -537,7 +537,10 @@ gb_internal Type *check_record_polymorphic_params(CheckerContext *ctx, Ast *poly
 						e->TypeName.is_type_alias = true;
 						e->flags |= EntityFlag_PolyConst;
 					} else {
-						Type *t = determine_type_from_polymorphic(ctx, type, operand);
+						Type *t = operand.type;
+						if (is_type_proc(type)) {
+							t = determine_type_from_polymorphic(ctx, type, operand);
+						}
 						if (is_type_polymorphic(base_type(t))) {
 							*is_polymorphic_ = true;
 							can_check_fields = false;