in conditional type, type parameter T is inferred as X, but [X] extends [T] is false #43123
Labels
Bug
A bug in TypeScript
Domain: Conditional Types
The issue relates to conditional types
Fix Available
A PR has been opened for this issue
Milestone
Bug Report
🔎 Search Terms
conditional inference, tuple, never
🕗 Version & Regression Information
⏯ Playground Link
Playground link
💻 Code
🙁 Actual behavior
Hmm
is evaluated as[0, false]
. SomehowT
is inferred as0
, but[0]
doesn't extend[T]
?🙂 Expected behavior
Hmm
should be evaluated as[0, true]
as it does in TS 4.1.5 and below.This behavior was brought up in a Stack Overflow question asking why it happens; not sure if there's any actual use case for this.
The text was updated successfully, but these errors were encountered: