Skip to content

Conversation

Ladicek
Copy link
Contributor

@Ladicek Ladicek commented Apr 10, 2025

We first check that the number of passed arguments is equal to the number of declared parameters. Then, we check that TypeKind.asLoadable() of all arguments are equal to the loadable TypeKind of the corresponding parameters. This is technically relatively lax and only properly checks primitive types, but we don't have a type system to find out if references of different types (such as String and CharSequence) are assignable. Therefore, this is the best we can do (at least for now).

Fixes #309

We first check that the number of passed arguments is equal to the number
of declared parameters. Then, we check that `TypeKind.asLoadable()` of
all arguments are equal to the loadable `TypeKind` of the corresponding
parameters. This is technically relatively lax and only properly checks
primitive types, but we don't have a type system to find out if references
of different types (such as `String` and `CharSequence`) are assignable.
Therefore, this is the best we can do (at least for now).
@Ladicek Ladicek added the 2.x Issue applies to Gizmo 2.x label Apr 10, 2025
@Ladicek Ladicek requested review from dmlloyd and mkouba April 10, 2025 15:04
@Ladicek Ladicek moved this to In Progress in WG - Gizmo 2 Apr 10, 2025
@Ladicek Ladicek merged commit f61ef46 into quarkusio:main Apr 10, 2025
2 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in WG - Gizmo 2 Apr 10, 2025
@Ladicek Ladicek deleted the check-arguments-count-and-type-kinds branch April 10, 2025 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Issue applies to Gizmo 2.x
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

verify correct number of arguments were passed when invoking a method
2 participants