diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-03-23 18:46:20 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-03-23 18:48:12 -0400 |
| commit | 4d50bc3f8dd2b9fd5b7dde6f63f104aaba6dbf5a (patch) | |
| tree | 57890fd7b757fd39103327ffd05d1f4352d21128 /src/ir.cpp | |
| parent | 89953ec83d8afe4fed0fc9e3cdded09c7522bf86 (diff) | |
| download | zig-4d50bc3f8dd2b9fd5b7dde6f63f104aaba6dbf5a.tar.gz zig-4d50bc3f8dd2b9fd5b7dde6f63f104aaba6dbf5a.zip | |
add peer type resolution for `*const T` and `?*T`
closes #1298
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index f8301f0116..54b567efe5 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -9658,6 +9658,23 @@ static ZigType *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_node, ZigT continue; } + if (prev_type->id == ZigTypeIdOptional && + types_match_const_cast_only(ira, cur_type, prev_type->data.maybe.child_type, + source_node, false).id == ConstCastResultIdOk) + { + prev_inst = cur_inst; + any_are_null = true; + continue; + } + + if (cur_type->id == ZigTypeIdOptional && + types_match_const_cast_only(ira, prev_type, cur_type->data.maybe.child_type, + source_node, false).id == ConstCastResultIdOk) + { + any_are_null = true; + continue; + } + if (cur_type->id == ZigTypeIdUndefined) { continue; } |
