Fix ascription to array type to not convert units (#7160)

This commit is contained in:
Jonathan Tran
2025-05-21 17:22:30 -04:00
committed by GitHub
parent f5c244dbb1
commit ed979d807b
5 changed files with 142 additions and 82 deletions

View File

@ -177,7 +177,7 @@ impl Args {
)));
};
let arg = arg.value.coerce(ty, exec_state).map_err(|_| {
let arg = arg.value.coerce(ty, true, exec_state).map_err(|_| {
let actual_type = arg.value.principal_type();
let actual_type_name = actual_type
.as_ref()
@ -297,7 +297,7 @@ impl Args {
vec![self.source_range],
)))?;
let arg = arg.value.coerce(ty, exec_state).map_err(|_| {
let arg = arg.value.coerce(ty, true, exec_state).map_err(|_| {
let actual_type = arg.value.principal_type();
let actual_type_name = actual_type
.as_ref()