Skip to content

Commit 3aac11e

Browse files
committed
Accept new baselines
1 parent 0de3f5a commit 3aac11e

File tree

4 files changed

+132
-0
lines changed

4 files changed

+132
-0
lines changed

tests/baselines/reference/controlFlowGenericTypes.errors.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,4 +204,20 @@ tests/cases/conformance/controlFlow/controlFlowGenericTypes.ts(168,9): error TS2
204204
iSpec[null! as keyof PublicSpec];
205205
}
206206
}
207+
208+
// Repros from #45145
209+
210+
function f10<T extends { a: string } | undefined>(x: T, y: Partial<T>) {
211+
y = x;
212+
}
213+
214+
type SqlInsertSet<T> = T extends undefined ? object : { [P in keyof T]: unknown };
215+
216+
class SqlTable<T> {
217+
protected validateRow(_row: Partial<SqlInsertSet<T>>): void {
218+
}
219+
public insertRow(row: SqlInsertSet<T>) {
220+
this.validateRow(row);
221+
}
222+
}
207223

tests/baselines/reference/controlFlowGenericTypes.js

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

178194

179195
//// [controlFlowGenericTypes.js]
@@ -313,3 +329,17 @@ var TableBaseEnum = /** @class */ (function () {
313329
};
314330
return TableBaseEnum;
315331
}());
332+
// Repros from #45145
333+
function f10(x, y) {
334+
y = x;
335+
}
336+
var SqlTable = /** @class */ (function () {
337+
function SqlTable() {
338+
}
339+
SqlTable.prototype.validateRow = function (_row) {
340+
};
341+
SqlTable.prototype.insertRow = function (row) {
342+
this.validateRow(row);
343+
};
344+
return SqlTable;
345+
}());

tests/baselines/reference/controlFlowGenericTypes.symbols

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,3 +525,52 @@ class TableBaseEnum<
525525
}
526526
}
527527

528+
// Repros from #45145
529+
530+
function f10<T extends { a: string } | undefined>(x: T, y: Partial<T>) {
531+
>f10 : Symbol(f10, Decl(controlFlowGenericTypes.ts, 174, 1))
532+
>T : Symbol(T, Decl(controlFlowGenericTypes.ts, 178, 13))
533+
>a : Symbol(a, Decl(controlFlowGenericTypes.ts, 178, 24))
534+
>x : Symbol(x, Decl(controlFlowGenericTypes.ts, 178, 50))
535+
>T : Symbol(T, Decl(controlFlowGenericTypes.ts, 178, 13))
536+
>y : Symbol(y, Decl(controlFlowGenericTypes.ts, 178, 55))
537+
>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --))
538+
>T : Symbol(T, Decl(controlFlowGenericTypes.ts, 178, 13))
539+
540+
y = x;
541+
>y : Symbol(y, Decl(controlFlowGenericTypes.ts, 178, 55))
542+
>x : Symbol(x, Decl(controlFlowGenericTypes.ts, 178, 50))
543+
}
544+
545+
type SqlInsertSet<T> = T extends undefined ? object : { [P in keyof T]: unknown };
546+
>SqlInsertSet : Symbol(SqlInsertSet, Decl(controlFlowGenericTypes.ts, 180, 1))
547+
>T : Symbol(T, Decl(controlFlowGenericTypes.ts, 182, 18))
548+
>T : Symbol(T, Decl(controlFlowGenericTypes.ts, 182, 18))
549+
>P : Symbol(P, Decl(controlFlowGenericTypes.ts, 182, 57))
550+
>T : Symbol(T, Decl(controlFlowGenericTypes.ts, 182, 18))
551+
552+
class SqlTable<T> {
553+
>SqlTable : Symbol(SqlTable, Decl(controlFlowGenericTypes.ts, 182, 82))
554+
>T : Symbol(T, Decl(controlFlowGenericTypes.ts, 184, 15))
555+
556+
protected validateRow(_row: Partial<SqlInsertSet<T>>): void {
557+
>validateRow : Symbol(SqlTable.validateRow, Decl(controlFlowGenericTypes.ts, 184, 19))
558+
>_row : Symbol(_row, Decl(controlFlowGenericTypes.ts, 185, 26))
559+
>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --))
560+
>SqlInsertSet : Symbol(SqlInsertSet, Decl(controlFlowGenericTypes.ts, 180, 1))
561+
>T : Symbol(T, Decl(controlFlowGenericTypes.ts, 184, 15))
562+
}
563+
public insertRow(row: SqlInsertSet<T>) {
564+
>insertRow : Symbol(SqlTable.insertRow, Decl(controlFlowGenericTypes.ts, 186, 5))
565+
>row : Symbol(row, Decl(controlFlowGenericTypes.ts, 187, 21))
566+
>SqlInsertSet : Symbol(SqlInsertSet, Decl(controlFlowGenericTypes.ts, 180, 1))
567+
>T : Symbol(T, Decl(controlFlowGenericTypes.ts, 184, 15))
568+
569+
this.validateRow(row);
570+
>this.validateRow : Symbol(SqlTable.validateRow, Decl(controlFlowGenericTypes.ts, 184, 19))
571+
>this : Symbol(SqlTable, Decl(controlFlowGenericTypes.ts, 182, 82))
572+
>validateRow : Symbol(SqlTable.validateRow, Decl(controlFlowGenericTypes.ts, 184, 19))
573+
>row : Symbol(row, Decl(controlFlowGenericTypes.ts, 187, 21))
574+
}
575+
}
576+

tests/baselines/reference/controlFlowGenericTypes.types

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,3 +505,40 @@ class TableBaseEnum<
505505
}
506506
}
507507

508+
// Repros from #45145
509+
510+
function f10<T extends { a: string } | undefined>(x: T, y: Partial<T>) {
511+
>f10 : <T extends { a: string; } | undefined>(x: T, y: Partial<T>) => void
512+
>a : string
513+
>x : T
514+
>y : Partial<T>
515+
516+
y = x;
517+
>y = x : T
518+
>y : Partial<T>
519+
>x : T
520+
}
521+
522+
type SqlInsertSet<T> = T extends undefined ? object : { [P in keyof T]: unknown };
523+
>SqlInsertSet : SqlInsertSet<T>
524+
525+
class SqlTable<T> {
526+
>SqlTable : SqlTable<T>
527+
528+
protected validateRow(_row: Partial<SqlInsertSet<T>>): void {
529+
>validateRow : (_row: Partial<SqlInsertSet<T>>) => void
530+
>_row : Partial<SqlInsertSet<T>>
531+
}
532+
public insertRow(row: SqlInsertSet<T>) {
533+
>insertRow : (row: SqlInsertSet<T>) => void
534+
>row : SqlInsertSet<T>
535+
536+
this.validateRow(row);
537+
>this.validateRow(row) : void
538+
>this.validateRow : (_row: Partial<SqlInsertSet<T>>) => void
539+
>this : this
540+
>validateRow : (_row: Partial<SqlInsertSet<T>>) => void
541+
>row : SqlInsertSet<T>
542+
}
543+
}
544+

0 commit comments

Comments
 (0)