aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 29cd794b5a..95896d9a2f 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -111,6 +111,7 @@ TypeTableEntry *new_type_table_entry(TypeTableEntryId id) {
case TypeTableEntryIdMaybe:
case TypeTableEntryIdFn:
case TypeTableEntryIdError:
+ case TypeTableEntryIdUndefLit:
// nothing to init
break;
case TypeTableEntryIdStruct:
@@ -1063,6 +1064,7 @@ static bool type_has_codegen_value(TypeTableEntryId id) {
case TypeTableEntryIdUnreachable:
case TypeTableEntryIdNumLitFloat:
case TypeTableEntryIdNumLitInt:
+ case TypeTableEntryIdUndefLit:
return false;
case TypeTableEntryIdBool:
@@ -2481,10 +2483,9 @@ static TypeTableEntry *analyze_undefined_literal_expr(CodeGen *g, ImportTableEnt
ConstExprValue *const_val = &expr->const_val;
const_val->ok = true;
+ const_val->undef = true;
- zig_panic("TODO");
-
- return expected_type;
+ return expected_type ? expected_type : g->builtin_types.entry_undef;
}