Skip to content

Commit

Permalink
fix: Restored mistakenly commented placeholder multi-parent check
Browse files Browse the repository at this point in the history
  • Loading branch information
giann committed Sep 19, 2024
1 parent 4306bab commit b1bd476
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/Parser.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1790,7 +1790,7 @@ fn resolvePlaceholderWithRelation(
self.reporter.reportErrorFmt(
.map_key_type,
self.ast.tokens.get(child_placeholder.where),
"`{s}` can't be subscripted",
"Bad key type for `{s}`",
.{
(try resolved_type.toStringAlloc(self.gc.allocator)).items,
},
Expand Down
30 changes: 15 additions & 15 deletions src/obj.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5025,21 +5025,21 @@ pub const PlaceholderDef = struct {
return;
}

// if (child.resolved_type.?.Placeholder.parent != null) {
// if (BuildOptions.debug_placeholders) {
// io.print(
// ">>> Placeholder @{} ({s}) has already a {} relation with @{} ({s})\n",
// .{
// @intFromPtr(child),
// if (child.resolved_type.?.Placeholder.name) |name| name.string else "unknown",
// child.resolved_type.?.Placeholder.parent_relation.?,
// @intFromPtr(child.resolved_type.?.Placeholder.parent.?),
// if (child.resolved_type.?.Placeholder.parent.?.resolved_type.?.Placeholder.name) |name| name.string else "unknown",
// },
// );
// }
// return;
// }
if (child.resolved_type.?.Placeholder.parent != null) {
if (BuildOptions.debug_placeholders) {
io.print(
">>> Placeholder @{} ({s}) has already a {} relation with @{} ({s})\n",
.{
@intFromPtr(child),
if (child.resolved_type.?.Placeholder.name) |name| name.string else "unknown",
child.resolved_type.?.Placeholder.parent_relation.?,
@intFromPtr(child.resolved_type.?.Placeholder.parent.?),
if (child.resolved_type.?.Placeholder.parent.?.resolved_type.?.Placeholder.name) |name| name.string else "unknown",
},
);
}
return;
}

child.resolved_type.?.Placeholder.parent = parent;
try parent.resolved_type.?.Placeholder.children.append(child);
Expand Down

0 comments on commit b1bd476

Please sign in to comment.