Skip to content

Conversation

@xterao
Copy link
Collaborator

@xterao xterao commented Jul 31, 2025

Summary

  • Fixed PsiTypeChecker to correctly validate primitive return types for DAO methods
  • All primitive types except char are now accepted as valid return types
  • Previously, all primitive types were incorrectly rejected due to a logic error

Changes

  • Updated PsiTypeChecker.isBaseClassType() to return true for all primitive types except char
  • Added comprehensive test cases for all primitive return types in SelectReturnTypeTestDao
  • Updated test cases in FunctionReturnTypeTestDao to reflect the correct validation behavior

Test Plan

  • Added test methods for all primitive return types (int, long, boolean, double, float, byte, short)
  • Added test method for char return type to verify it still shows an error
  • Ran ./gradlew test to ensure all tests pass
  • Ran ./gradlew spotlessApply to ensure code formatting

Fixes #351

🤖 Generated with Claude Code

@github-actions github-actions bot added the fix Bug fixes label Jul 31, 2025
@xterao xterao self-assigned this Jul 31, 2025
- Updated PsiTypeChecker.isBaseClassType to accept all primitive types except 'char'
- Previously, all primitive types were incorrectly rejected
- Added test cases for all primitive return types in SelectReturnTypeTestDao and FunctionReturnTypeTestDao
- char primitive type remains unsupported as per Doma specification

Fixes #351

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@xterao xterao force-pushed the fix/primitive-type-validation-issue-351 branch from 7a100fc to bede023 Compare July 31, 2025 04:40
@xterao xterao merged commit 29acf19 into main Aug 1, 2025
5 checks passed
@xterao xterao deleted the fix/primitive-type-validation-issue-351 branch August 1, 2025 05:21
@xterao xterao added this to the ver2.0.0 Release milestone Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Primitive Type Validation for DAO Method Return Types

2 participants