From 1a0081b763d145de8a89ab94aca400daa5666dac Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 22 Apr 2017 11:45:04 -0400 Subject: add peer type resolution for T and ?T See #334 --- src/ir.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index 75c49dc53a..941210d583 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -6120,6 +6120,15 @@ static TypeTableEntry *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_nod { prev_inst = cur_inst; continue; + } else if (prev_type->id == TypeTableEntryIdMaybe && + types_match_const_cast_only(prev_type->data.maybe.child_type, cur_type)) + { + continue; + } else if (cur_type->id == TypeTableEntryIdMaybe && + types_match_const_cast_only(cur_type->data.maybe.child_type, prev_type)) + { + prev_inst = cur_inst; + continue; } else if (prev_type->id == TypeTableEntryIdNumLitInt || prev_type->id == TypeTableEntryIdNumLitFloat) { -- cgit v1.2.3