diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-01-22 23:12:33 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-01-22 23:12:33 -0700 |
| commit | e269caae02778c5b15a101c42d2d2d5150af59c8 (patch) | |
| tree | 6c9244e636c03fbd732fd7277740a0309a43b990 /src/analyze.cpp | |
| parent | 0e51c16ef57b3b8239c512d78f0dcafb202be21c (diff) | |
| download | zig-e269caae02778c5b15a101c42d2d2d5150af59c8.tar.gz zig-e269caae02778c5b15a101c42d2d2d5150af59c8.zip | |
implement undefined literal
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 7 |
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; } |
