Skip to content

@switch does not have type awareness in case statements #52315

@jpike88

Description

@jpike88

Which @angular/* package(s) are the source of the bug?

compiler-cli

Is this a regression?

No

Description

Am using package versions of 17.0.0-rc.0, with extension version v17.0.0-next.2.

When either using ng build or in vscode itself, there is no error thrown for the below code, isDebug is type boolean yet the case statements conflict with that type.
Screenshot 2023-10-23 at 08 56 57

Interestingly on mouseover, it does look like an attempt to perform type coercion happens, resulting predictably in a never type
Screenshot 2023-10-23 at 08 58 41

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

No response

Anything else?

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions