Fix access of undefined field when calling ast.Tree.dump

This commit is contained in:
Merlyn Morgan-Graham 2019-12-09 22:56:21 -08:00
parent fe415dae04
commit 5e8186a8ce

View File

@ -967,7 +967,9 @@ pub const Node = struct {
pub fn iterate(self: *ParamDecl, index: usize) ?*Node {
var i = index;
if (i < 1) return self.type_node;
if (i < 1) {
return if (self.var_args_token == null) self.type_node else null;
}
i -= 1;
return null;