Skip to content

Commit b29930e

Browse files
committed
ast_cloner: clone test node for conditionals
Signed-off-by: Wojciech Sipak <[email protected]>
1 parent 71bf498 commit b29930e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

xls/dslx/frontend/ast_cloner.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,8 +1110,10 @@ class AstCloner : public AstNodeVisitor {
11101110
const ConstConditionalTypeAnnotation* n) override {
11111111
XLS_RETURN_IF_ERROR(ReplaceOrVisit(n->consequent_type()));
11121112
XLS_RETURN_IF_ERROR(ReplaceOrVisit(n->alternate_type()));
1113+
XLS_RETURN_IF_ERROR(ReplaceOrVisit(n->test()));
11131114
old_to_new_[n] = module(n)->Make<ConstConditionalTypeAnnotation>(
1114-
n->span(), n->test(),
1115+
n->span(),
1116+
down_cast<Expr*>(old_to_new_[n->test()]),
11151117
down_cast<TypeAnnotation*>(old_to_new_[n->consequent_type()]),
11161118
down_cast<TypeAnnotation*>(old_to_new_[n->alternate_type()]));
11171119
return absl::OkStatus();

0 commit comments

Comments
 (0)