TypeScript Version: 3.0.3
Search Terms:
Code
declare function fn(x: 'a'): 0
declare function fn(x: 'b'): 1
declare function fn(x: 'c'): 2
declare function fn(x: 'D'): 3
// expected: type One = 1
// received: type One = never
type One = (typeof fn) extends (x: 'b') => infer Return ? Return : never
const one: One = 1
Expected behavior:
One should be 1
Actual behavior:
One is never
Playground Link: link
Related Issues: #26591