Skip to content

Commit 0de3f5a

Browse files
committed
Add regression tests
1 parent 7f66370 commit 0de3f5a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/cases/conformance/controlFlow/controlFlowGenericTypes.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,19 @@ class TableBaseEnum<
175175
iSpec[null! as keyof PublicSpec];
176176
}
177177
}
178+
179+
// Repros from #45145
180+
181+
function f10<T extends { a: string } | undefined>(x: T, y: Partial<T>) {
182+
y = x;
183+
}
184+
185+
type SqlInsertSet<T> = T extends undefined ? object : { [P in keyof T]: unknown };
186+
187+
class SqlTable<T> {
188+
protected validateRow(_row: Partial<SqlInsertSet<T>>): void {
189+
}
190+
public insertRow(row: SqlInsertSet<T>) {
191+
this.validateRow(row);
192+
}
193+
}

0 commit comments

Comments
 (0)