Skip to content

Type parameter in template literal type is inferred as neverΒ #45906

@zyf0330

Description

@zyf0330

Bug Report

πŸ”Ž Search Terms

Template Literal Type
Default Value of Generic
Property Chain

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about Template Literay Type_

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

πŸ™ Actual behavior

  1. F, F1, F2 in function chain is infered wrongly as never, never, never when only first level property field is passed
  2. F2 in function chain("a.b") is infered as never

πŸ™‚ Expected behavior

  1. F in function chain is infered correctly as "a", undefined, undefined when only one argument field is passed
  2. F2 in function chain("a.b") is infered as undefined

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions