BugDomain: check: Type InferenceHelp Wanted
仓库指标
- Star
- (48,455 star)
- PR 合并指标
- (平均合并 6天 17小时) (30 天内合并 9 个 PR)
描述
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