Try expression support
This commit is contained in:
parent
4acb77f09e
commit
03f774fda9
@ -345,6 +345,17 @@ pub fn resolveTypeOfNode(analysis_ctx: *AnalysisContext, node: *ast.Node) ?*ast.
|
|||||||
else => unreachable,
|
else => unreachable,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
.Try => {
|
||||||
|
const rhs_type = resolveTypeOfNode(analysis_ctx, prefix_op.rhs) orelse return null;
|
||||||
|
switch (rhs_type.id) {
|
||||||
|
.InfixOp => {
|
||||||
|
const infix_op = rhs_type.cast(ast.Node.InfixOp).?;
|
||||||
|
if (infix_op.op == .ErrorUnion) return infix_op.rhs;
|
||||||
|
},
|
||||||
|
else => {},
|
||||||
|
}
|
||||||
|
return rhs_type;
|
||||||
|
},
|
||||||
else => {},
|
else => {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user