diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-04-22 11:45:04 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-04-22 11:45:04 -0400 |
| commit | 1a0081b763d145de8a89ab94aca400daa5666dac (patch) | |
| tree | 8899983ac5f34d8b47b5e31caa6c311e9c773100 /src/ir.cpp | |
| parent | e0b635e825b72e1308dd0e2bbee578dafe62d9dc (diff) | |
| download | zig-1a0081b763d145de8a89ab94aca400daa5666dac.tar.gz zig-1a0081b763d145de8a89ab94aca400daa5666dac.zip | |
add peer type resolution for T and ?T
See #334
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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) { |
