Open
Description
openedon Dec 26, 2022
Bug Report
π Search Terms
Conditional type, assigned to, assigned from, type arguments
π Version & Regression Information
- This is a crash: no
- This changed between versions 4.2.3 and 4.3.5
β― Playground Link
Playground link with relevant code
π» Code
function test<T extends {}>() {
type T1 = T extends {} ? true : false;
type T2 = T & {} extends {} ? true : false;
const t1a: T1 = true; // Errors?
const t2a: T2 = true; // Ok
const t1b: true = make<T1>(); // Ok
const t2b: true = make<T2>(); // Errors?
}
declare function make<T>(): T;
π Actual behavior
true
is not assignable toT1
.T2
is not assignable totrue
.
π Expected behavior
true
is assignable toT1
.T2
is assignable totrue
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment