Closed
Description
TypeScript Version: 3.2.0-rc <= 3.4.0-dev.20190220
Search Terms: Required
Code
const a: Required<{ a?: 1; x: 1 }> = { a: 1, x: 1 };
const b: Required<{ b?: 1; x: 1 }> = { b: 1, x: 1 };
export let A = a;
export let B = b;
A = b; // No Error
B = a; // No Error
a.b; // Property 'b' does not exist on type 'Required<{ a?: 1; x: 1; }>'.
b.a; // Property 'a' does not exist on type 'Required<{ b?: 1; x: 1; }>'.
Expected behavior:
Error:(5, 1) TS2322: Type 'Required<{ b?: 1 | undefined; x: 1; }>' is not assignable to type 'Required<{ a?: 1 | undefined; x: 1; }>'.
Property 'a' is missing in type 'Required<{ b?: 1 | undefined; x: 1; }>'.
Error:(6, 1) TS2322: Type 'Required<{ a?: 1 | undefined; x: 1; }>' is not assignable to type 'Required<{ b?: 1 | undefined; x: 1; }>'.
Property 'b' is missing in type 'Required<{ a?: 1 | undefined; x: 1; }>'.
When it is "3.1.6" it will be like that.
Actual behavior:
No Error
Playground Link:
Related Issues: