From 8236c6d4b7f75f2e20332b0b4181b259336f9a4a Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 11 Jun 2018 22:50:13 +0100 Subject: Allow for base enum type with an enum declaration --- src/check_expr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/check_expr.cpp') diff --git a/src/check_expr.cpp b/src/check_expr.cpp index ea9936235..855be62e1 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -486,6 +486,12 @@ i64 check_distance_between_types(CheckerContext *c, Operand *operand, Type *type } } + if (is_type_enum(dst) && are_types_identical(dst->Enum.base_type, operand->type)) { + if (c->in_enum_type) { + return 3; + } + } + #if 0 if (are_types_identical(dst, src) && (!is_type_named(dst) || !is_type_named(src))) { return 1; -- cgit v1.2.3