aboutsummaryrefslogtreecommitdiff
path: root/src/checker/checker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/checker/checker.cpp')
-rw-r--r--src/checker/checker.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/checker/checker.cpp b/src/checker/checker.cpp
index 7d32f4cce..f9000446e 100644
--- a/src/checker/checker.cpp
+++ b/src/checker/checker.cpp
@@ -619,9 +619,11 @@ void add_type_and_value(CheckerInfo *i, AstNode *expression, AddressingMode mode
return;
if (mode == Addressing_Constant) {
- GB_ASSERT(value.kind != ExactValue_Invalid);
- if (!(type != t_invalid || is_type_constant_type(type))) {
- compiler_error("add_type_and_value - invalid type: %s", type_to_string(type));
+ if (is_type_constant_type(type)) {
+ GB_ASSERT(value.kind != ExactValue_Invalid);
+ if (!(type != t_invalid || is_type_constant_type(type))) {
+ compiler_error("add_type_and_value - invalid type: %s", type_to_string(type));
+ }
}
}