fix(const_eval): allow casts from AbstractInt to itself (#7657)

This commit is contained in:
Erich Gubler 2025-06-11 18:06:20 +09:00 committed by GitHub
parent 9046b439d7
commit 77def411c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1845,6 +1845,10 @@ impl<'a> ConstantEvaluator<'a> {
Literal::AbstractFloat(v) => v,
_ => return make_error(),
}),
Sc::ABSTRACT_INT => Literal::AbstractInt(match literal {
Literal::AbstractInt(v) => v,
_ => return make_error(),
}),
_ => {
log::debug!("Constant evaluator refused to convert value to {target:?}");
return make_error();