Skip to content
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

fix: EXPOSED-54 CaseWhen.Else returns narrow Expression<R> #1800

Merged
merged 3 commits into from
Jul 27, 2023

Commits on Jul 26, 2023

  1. 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.
    bog-walk committed Jul 26, 2023
    Configuration menu
    Copy the full SHA
    7f63c5f View commit details
    Browse the repository at this point in the history
  2. ix: EXPOSED-54 CaseWhen.Else returns narrow Expression<R>

    Remove forgotten logger.
    bog-walk committed Jul 26, 2023
    Configuration menu
    Copy the full SHA
    829696e View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2023

  1. fix: EXPOSED-54 CaseWhen.Else returns narrow Expression<R>

    Remove Unit return type and replace assignment operator with block body.
    bog-walk committed Jul 27, 2023
    Configuration menu
    Copy the full SHA
    540c4ad View commit details
    Browse the repository at this point in the history