Closed
Description
Bug Report
Since 4.6 TS is complaining about that false
is not assignable to boolean
, when it is "wrapped by interface".
🔎 Search Terms
4.6 type
🕗 Version & Regression Information
- This is a compile problem
- This changed between versions 4.5.5 and 4.6
⏯ Playground Link
💻 Code
interface Observable<T>
{
(): T;
(value: T): any;
}
function observable<T>(value: T): Observable<T>
{
return undefined as any; // the implementation is not important
}
const x: Observable<boolean> = observable(false);
🙁 Actual behavior
Type 'Observable<false>' is not assignable to type 'Observable<boolean>'.
Types of parameters 'value' and 'value' are incompatible.
Type 'boolean' is not assignable to type 'false'.
🙂 Expected behavior
No compiler problem as in previous versions.