-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: check: Type InferenceRelated to type inference performed during signature resolution or `infer` type resolutionRelated to type inference performed during signature resolution or `infer` type resolutionHelp WantedYou can do thisYou can do this
Milestone
Description
Bug Report
π Search Terms
- union type
π Version & Regression Information
- bug exists in 4.2
- works in 4.1
β― Playground Link
When using union types with helper function constructing one of the type, the type is incorrectly loosened from string value type to string (func1). Directly returning the shape (func2) or using as const (func3) fixes it. Also when simplifying and removing the union (func4), it starts working.
This was not problem in 4.1, errors only in 4.2
kharvd
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: check: Type InferenceRelated to type inference performed during signature resolution or `infer` type resolutionRelated to type inference performed during signature resolution or `infer` type resolutionHelp WantedYou can do thisYou can do this