Closed
Description
TypeScript Version: 2.2.0
Code
type T = 'a' | 'b'
const f1 = () => true ? 'a' : 'b'
const f2 = () => true ? 'a' : 'a'
const v1: T = f1()
const v2: T = f2()
Expected behavior:
Both will be ok.
Actual behavior:
Only the former is ok.
index.ts(7,7): error TS2322: Type 'string' is not assignable to type 'T'.