diff options
| author | Josh Wolfe <thejoshwolfe@gmail.com> | 2015-12-15 04:05:43 -0700 |
|---|---|---|
| committer | Josh Wolfe <thejoshwolfe@gmail.com> | 2015-12-15 04:05:53 -0700 |
| commit | f2a9b40231f982b10c4d098c60b47da890396c1f (patch) | |
| tree | 63a8b8af9120203ff6f7dfaa05681346276e3c94 /src/analyze.cpp | |
| parent | cf88fcb2ad31b64296d906ef525e76bbe6c3f65e (diff) | |
| download | zig-f2a9b40231f982b10c4d098c60b47da890396c1f.tar.gz zig-f2a9b40231f982b10c4d098c60b47da890396c1f.zip | |
more number literal syntax is supported. floats still need work
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index 5ba0ae16a7..5e6b0a3558 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -640,13 +640,7 @@ static bool num_lit_fits_in_other_type(CodeGen *g, TypeTableEntry *literal_type, case TypeTableEntryIdStruct: return false; case TypeTableEntryIdInt: - if (is_num_lit_signed(num_lit)) { - if (!other_type->data.integral.is_signed) { - return false; - } - - return lit_size_in_bits <= other_type->size_in_bits; - } else if (is_num_lit_unsigned(num_lit)) { + if (is_num_lit_unsigned(num_lit)) { return lit_size_in_bits <= other_type->size_in_bits; } else { @@ -883,12 +877,6 @@ static TypeTableEntry * resolve_number_literals(CodeGen *g, AstNode *node1, AstN codegen_num_lit_1->resolved_type = g->builtin_types.entry_f64; codegen_num_lit_2->resolved_type = g->builtin_types.entry_f64; return g->builtin_types.entry_f64; - } else if (is_num_lit_signed(type1->data.num_lit.kind) && - is_num_lit_signed(type2->data.num_lit.kind)) - { - codegen_num_lit_1->resolved_type = g->builtin_types.entry_i64; - codegen_num_lit_2->resolved_type = g->builtin_types.entry_i64; - return g->builtin_types.entry_i64; } else if (is_num_lit_unsigned(type1->data.num_lit.kind) && is_num_lit_unsigned(type2->data.num_lit.kind)) { |
