1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
=== tests/cases/compiler/relatedViaDiscriminatedTypeNoError2.ts ===
type AObjOrBObj = { name: "A" } | { name: "B" };
>AObjOrBObj : { name: "A"; } | { name: "B"; }
>name : "A"
>name : "B"
type AOrBObj = { name: "A" | "B" };
>AOrBObj : { name: "A" | "B"; }
>name : "A" | "B"
type Generic<T extends AObjOrBObj> = T;
>Generic : T
type T = Generic<AOrBObj>;
>T : AOrBObj
declare let x: AObjOrBObj;
>x : AObjOrBObj
declare let y: AOrBObj;
>y : AOrBObj
x = y;
>x = y : AOrBObj
>x : AObjOrBObj
>y : AOrBObj
y = x;
>y = x : AObjOrBObj
>y : AOrBObj
>x : AObjOrBObj
|