Commit a03420c
committed
Fix missing checks that args match top-level
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)
```params
1 parent b2ec9e5 commit a03420c
File tree
1 file changed
+1
-1
lines changed1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| |||
0 commit comments