Skip to content

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

Closed

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

Activity

  1. jpike88 commented on Oct 23, 2023

    @jpike88
    Author

    closed because duplicate issue #52107

  2. jpike88 commented on Oct 23, 2023

    @jpike88
    Author

    actually its not a dupe, that other issue is about exhaustive type checking, my one is about more basic type awareness

  3. self-assigned this
    on Oct 23, 2023
  4. added
    core: control flow
    on Oct 23, 2023
  5. added a commit that references this issue on Oct 23, 2023
    5f453db
  6. added a commit that references this issue on Oct 23, 2023
    81c315e
  7. angular-automatic-lock-bot commented on Nov 23, 2023

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  8. locked and limited conversation to collaborators on Nov 23, 2023
  9. added a commit that references this issue on Jan 23, 2024
    2a8117c
  10. added a commit that references this issue on Jan 26, 2024
    dc3f7cb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugcore: control flowstate: has PR

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions