-
Notifications
You must be signed in to change notification settings - Fork 0
Check Parameter Types for Method Calls in Bind Variables #448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…during reference resolution as well.
… on a static field.
…thods and static methods.
… streamline error highlighting
(cherry picked from commit 722ab2c)
…ity and consistency
When `doma.expr.functions` is present, always resolve function definitions from the original defining class.
…for obtaining method types.
…re resolved correctly.
… correctly retrieves the preceding elements.
…d the logic for fetching the most recently analyzed item.
…etion provider and parameter extension
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive parameter type checking for method calls referenced as bind variables in SQL files. It enables accurate validation by verifying parameter counts and types for instance methods, static methods, custom functions, and built-in functions used in SQL bind variables.
- Implements parameter type validation for method calls in bind variables
- Adds validation for parameter count mismatches
- Introduces type compatibility checking with support for boxing/unboxing and inheritance
Reviewed Changes
Copilot reviewed 76 out of 76 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ValidationResultFunctionCallParameterTypeMismatch.kt | New validation result class for type mismatch errors |
| ValidationResultFunctionCallParameterCount.kt | New validation result class for parameter count errors |
| InspectionFunctionCallVisitorProcessor.kt | Enhanced processor with parameter validation logic |
| MethodMatcher.kt | New utility class for method parameter matching |
| FieldMethodResolver.kt | New resolver for field and method access with parameter validation |
| PsiParentClass.kt | Enhanced with method finding capabilities for parameter validation |
| SqlElExtensions.kt | Added parameter type extraction functionality |
| TypeUtil.kt | Added type compatibility checking methods |
| ForDirectiveUtil.kt | Refactored to use new method resolution system |
| Test files | Comprehensive test data and cases for validation scenarios |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This update adds parameter type checking for methods called as bind variables in SQL.
It verifies the number and types of arguments for methods referenced as bind variables by retrieving actual method definitions, enabling accurate code completion and reference resolution.
Scope of Checks
Validation Details
Type Checking Rules
Integerandint) are considered compatibleCharSequenceandStringare considered compatible