remove compile error for peer result comptime_int and null

closes #2763
This commit is contained in:
Andrew Kelley
2019-12-07 13:03:43 -05:00
parent ecb77af534
commit edebe0586b
2 changed files with 22 additions and 7 deletions

View File

@@ -11438,13 +11438,7 @@ static ZigType *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_node, ZigT
}
}
} else if (any_are_null && prev_inst->value->type->id != ZigTypeIdNull) {
if (prev_inst->value->type->id == ZigTypeIdComptimeInt ||
prev_inst->value->type->id == ZigTypeIdComptimeFloat)
{
ir_add_error_node(ira, source_node,
buf_sprintf("unable to make maybe out of number literal"));
return ira->codegen->builtin_types.entry_invalid;
} else if (prev_inst->value->type->id == ZigTypeIdOptional) {
if (prev_inst->value->type->id == ZigTypeIdOptional) {
return prev_inst->value->type;
} else {
if ((err = type_resolve(ira->codegen, prev_inst->value->type, ResolveStatusSizeKnown)))