Add regression test

This commit is contained in:
Anders Hejlsberg
2019-07-04 16:27:03 -10:00
parent d7f8f0072e
commit de2fb9584e
@@ -134,3 +134,10 @@ function test<T extends { a: string, b: string }>(obj: T): T {
let { a, ...rest } = obj;
return { a: 'hello', ...rest } as T;
}
// Repro from #32169
declare function f<T>(x: T): NonNullable<T>;
enum E { A, B }
const a = f(E.A);
const b: E.A = a;