diff --git a/changelog.d/10682-codegen-testbuild-missing-field.md b/changelog.d/10682-codegen-testbuild-missing-field.md new file mode 100644 index 0000000000..7572d77d62 --- /dev/null +++ b/changelog.d/10682-codegen-testbuild-missing-field.md @@ -0,0 +1,11 @@ +**Fix the `perry-codegen` lib-test build, which `-D warnings --all-targets` rejects on `main`.** + +#10484's `constructor_has_synthetic_arguments` field was added to `ImportedClass`, but two test +fixtures construct that struct literally and were never updated: +`expr/instanceof_imported_rhs_tests.rs` and `lower_call/new_builtin_shadow_tests.rs`. Both now set +it to `false`, which is the pre-#10484 behaviour they were written against. + +`cargo check -p perry-codegen --lib` does not compile `cfg(test)` code, so this is invisible to the +per-crate preflight and only the workspace-wide `--all-targets` step sees it — which is why it +reached `main`. Verified: `RUSTFLAGS="-D warnings" cargo check --workspace --all-targets` (with the +usual cross-host UI exclusions) now finishes clean. diff --git a/crates/perry-codegen/src/expr/instanceof_imported_rhs_tests.rs b/crates/perry-codegen/src/expr/instanceof_imported_rhs_tests.rs index a58793068b..9471ce5a66 100644 --- a/crates/perry-codegen/src/expr/instanceof_imported_rhs_tests.rs +++ b/crates/perry-codegen/src/expr/instanceof_imported_rhs_tests.rs @@ -49,6 +49,7 @@ fn imported_class(name: &str, class_id: u32) -> ImportedClass { namespace: None, source_prefix: "lib_ts".to_string(), constructor_param_count: 0, + constructor_has_synthetic_arguments: false, has_own_constructor: true, constructor_has_rest: false, has_instance_fields: false, diff --git a/crates/perry-codegen/src/lower_call/new_builtin_shadow_tests.rs b/crates/perry-codegen/src/lower_call/new_builtin_shadow_tests.rs index 98cbad3866..8583a4b53e 100644 --- a/crates/perry-codegen/src/lower_call/new_builtin_shadow_tests.rs +++ b/crates/perry-codegen/src/lower_call/new_builtin_shadow_tests.rs @@ -121,6 +121,7 @@ fn imported_class_of_the_same_name_already_shadowed_the_builtin() { namespace: None, source_prefix: "lib_ts".to_string(), constructor_param_count: 0, + constructor_has_synthetic_arguments: false, has_own_constructor: false, constructor_has_rest: false, has_instance_fields: false,