aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-04-22 11:45:04 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-04-22 11:45:04 -0400
commit1a0081b763d145de8a89ab94aca400daa5666dac (patch)
tree8899983ac5f34d8b47b5e31caa6c311e9c773100 /src/ir.cpp
parente0b635e825b72e1308dd0e2bbee578dafe62d9dc (diff)
downloadzig-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.cpp9
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)
{