Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Unity] Improved error message in ExprMutator::ReEmitBinding #16307

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/relax/ir/expr_functor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,15 @@ void ExprMutator::ReEmitBinding(const VarBindingNode* binding, Expr new_value) {
return;
}

Var temp = WithStructInfo(new_var, GetStructInfo(new_value));
auto new_sinfo = new_value->struct_info_.as<StructInfo>();

ICHECK(new_sinfo)
<< "InternalError: "
<< "In binding of variable " << binding->var << ", the value " << new_value
<< " does not have StructInfo. "
<< "This typically occurs when ReEmitBinding is called without first calling Normalize.";

Var temp = WithStructInfo(new_var, new_sinfo.value());
if (!temp.same_as(new_var)) {
new_var = temp;
}
Expand Down
Loading