Skip to content
This repository was archived by the owner on Sep 18, 2026. It is now read-only.
This repository was archived by the owner on Sep 18, 2026. It is now read-only.

Remember narrowed types in conditions #339

Description

@ondrejmirtes

Given this template:

<!-- ko if: alertErrorMessage() !== null -->
    <!-- ko text: alertErrorMessage --><!-- /ko -->
<!-- /ko -->

KOLint still complains with an error message like this:

Argument of type 'string | null' is not assignable to parameter of type 'string'.

The code should be compiled in such a way to make TypeScript understand that alertErrorMessage cannot be null inside the if.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions