Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing checks that args match top-level
params
Fixes kaitai-io/kaitai_struct#1086 Until now, top-level types were treated the same as opaque types, which had the unintended consequence that arguments passed to top-level types were not validated against the number and data types of declared parameters. This commit fixes the `formats_err` tests added in kaitai-io/kaitai_struct_tests@9d518e6 - more specifically, these failures in `sbt test` output are now fixed: ``` - params_call_bad_type_top_import *** FAILED *** [] did not equal [params_call_bad_type_top_import.ksy: /seq/0/type: error: can't pass argument #1 of type CalcFloatType into parameter `has_trailer` of type CalcBooleanType ] (SimpleMatchers.scala:34) - params_call_bad_type_top_local *** FAILED *** [] did not equal [params_call_bad_type_top_local.ksy: /seq/0/type: error: can't pass argument #1 of type CalcFloatType into parameter `has_trailer` of type CalcBooleanType ] (SimpleMatchers.scala:34) - params_call_too_many_top_import *** FAILED *** [] did not equal [params_call_too_many_top_import.ksy: /seq/0/type: error: parameter count mismatch: 2 declared, but 3 used ] (SimpleMatchers.scala:34) - params_call_too_many_top_local *** FAILED *** [] did not equal [params_call_too_many_top_local.ksy: /seq/0/type: error: parameter count mismatch: 2 declared, but 3 used ] (SimpleMatchers.scala:34) ```
- Loading branch information