-
Notifications
You must be signed in to change notification settings - Fork 695
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: EXPOSED-54 CaseWhen.Else returns narrow Expression<R>
The class CaseWhen has a function Else() with a return type Expression<R>, which creates an instance of the CaseWhenElse class. According to commit history, the CaseWhenElse class uses to also extend Expression<R>, but this was changed after a few years to extend ExpressionWithColumnType<R> instead. Inspite of this change, the return type of Else() did not change. This means that the same case written as a more verbose CaseWhenElse instance or written as a CaseWhen instance invoking Else() cannot be used interchangeably, for example as the argument in Coalesce(), which takes ExpressionWithColumnType<*>. Update Else() return type to be as broad as the instance it returns. Remove extra whitespace in Case query builder. Add unit test to ensure consistency. Fix Detekt issues.
- Loading branch information
Showing
3 changed files
with
61 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters