aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-06-11 22:50:13 +0100
committergingerBill <bill@gingerbill.org>2018-06-11 22:50:13 +0100
commit8236c6d4b7f75f2e20332b0b4181b259336f9a4a (patch)
tree7143ccf9b23f9580ba10a63e6af699dc14a22db9 /src/check_expr.cpp
parent555fe37ad8142f7daccf61ba7869a43376cd0441 (diff)
Allow for base enum type with an enum declaration
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp6
1 files changed, 6 insertions, 0 deletions
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;