Skip to content

TSTypeAssertion is not implemented by the Svelte compiler #15565

@mazen-isstech

Description

@mazen-isstech

Describe the bug

The Svelte compiler is not handling what the parser calls, TSTypeAssertion AST nodes.

About Typescript type assertions: https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#type-assertions

Whenever the compiler encounters such a cast-expression, it throws the error:

Not implemented TSTypeAssertion

This is not a critical bug, but is an annoyance as sometimes a type checker is unable to deduce the true types of some expressions, which can cause several false positives. Casting is what help "patch" these issues.

Reproduction

https://svelte.dev/playground/hello-world?version=5.23.2#H4sIAAAAAAAAA22OywrCMBBFfyXOJi2IxW1MC-78B-OitmMNxGlIxhel_25iXbq7HO6ZuRNQe0NQcEDnRvEcg-tFgb1l7EtYw8U6jKCOE_Db514Gif-svfeb-EDHmZ3biP94NxIjcToDOnbBehaupaGWHGVjyLBDFllUInKwNIha6CU1opDfTbLcGdLVomeJ9HXbLKOn7M4rXSViKD1kfDEoDnecT_MH1_OZN-IAAAA=

Logs

None provided, see reproduction.

System Info

System and binaries are the same as https://svelte.dev/playground/ (console says it's running Svelte compiler version 5.23.2).

Browsers:
  Brave Browser: 134.1.76.74

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions