From a20c31d6b509076141fe69f33d2fe3b465122f78 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 31 Oct 2019 22:58:38 +0000 Subject: Fix polymorphic record parameter determination bug caused by polymorphic constants not being handled correctly #447 --- src/check_type.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/check_type.cpp') diff --git a/src/check_type.cpp b/src/check_type.cpp index cf5855a3e..9f8310e44 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -461,6 +461,10 @@ void check_struct_type(CheckerContext *ctx, Type *struct_type, Ast *node, Array< e = alloc_entity_type_name(scope, token, operand.type); e->TypeName.is_type_alias = true; } else { + if (is_type_polymorphic(base_type(operand.type))) { + is_polymorphic = true; + can_check_fields = false; + } e = alloc_entity_constant(scope, token, operand.type, operand.value); } } else { -- cgit v1.2.3