From 3bfaac08446e36caaf83fb2121abdbfeb04e261e Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Wed, 20 Sep 2017 22:59:46 +0100 Subject: Fix decimal.odin assignment bug --- src/check_expr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/check_expr.cpp') diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 13b066835..d33cee97b 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -3324,7 +3324,6 @@ bool check_representable_as_constant(Checker *c, ExactValue in_value, Type *type } if (out_value) *out_value = v; - switch (type->Basic.kind) { // case Basic_f16: case Basic_f32: @@ -3333,6 +3332,8 @@ bool check_representable_as_constant(Checker *c, ExactValue in_value, Type *type case Basic_UntypedFloat: return true; + + default: GB_PANIC("Compiler error: Unknown float type!"); break; } } else if (is_type_complex(type)) { ExactValue v = exact_value_to_complex(in_value); @@ -3353,6 +3354,8 @@ bool check_representable_as_constant(Checker *c, ExactValue in_value, Type *type } break; case Basic_UntypedComplex: return true; + + default: GB_PANIC("Compiler error: Unknown complex type!"); break; } return false; -- cgit v1.2.3