Skip to content

Commit ebba3d6

Browse files
committed
Accept new baselines
1 parent 34b4dbb commit ebba3d6

File tree

3 files changed

+97
-0
lines changed

3 files changed

+97
-0
lines changed

tests/baselines/reference/keyofAndIndexedAccess.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,16 @@ class B extends A<{ x: number}> {
516516
p.x;
517517
}
518518
}
519+
520+
// Repro from #13749
521+
522+
class Form<T> {
523+
private childFormFactories: {[K in keyof T]: (v: T[K]) => Form<T[K]>}
524+
525+
public set<K extends keyof T>(prop: K, value: T[K]) {
526+
this.childFormFactories[prop](value)
527+
}
528+
}
519529

520530

521531
//// [keyofAndIndexedAccess.js]
@@ -862,6 +872,15 @@ var B = (function (_super) {
862872
};
863873
return B;
864874
}(A));
875+
// Repro from #13749
876+
var Form = (function () {
877+
function Form() {
878+
}
879+
Form.prototype.set = function (prop, value) {
880+
this.childFormFactories[prop](value);
881+
};
882+
return Form;
883+
}());
865884

866885

867886
//// [keyofAndIndexedAccess.d.ts]
@@ -1104,3 +1123,7 @@ declare class B extends A<{
11041123
}> {
11051124
f(p: this["props"]): void;
11061125
}
1126+
declare class Form<T> {
1127+
private childFormFactories;
1128+
set<K extends keyof T>(prop: K, value: T[K]): void;
1129+
}

tests/baselines/reference/keyofAndIndexedAccess.symbols

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,3 +1844,39 @@ class B extends A<{ x: number}> {
18441844
}
18451845
}
18461846

1847+
// Repro from #13749
1848+
1849+
class Form<T> {
1850+
>Form : Symbol(Form, Decl(keyofAndIndexedAccess.ts, 516, 1))
1851+
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 520, 11))
1852+
1853+
private childFormFactories: {[K in keyof T]: (v: T[K]) => Form<T[K]>}
1854+
>childFormFactories : Symbol(Form.childFormFactories, Decl(keyofAndIndexedAccess.ts, 520, 15))
1855+
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 521, 34))
1856+
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 520, 11))
1857+
>v : Symbol(v, Decl(keyofAndIndexedAccess.ts, 521, 50))
1858+
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 520, 11))
1859+
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 521, 34))
1860+
>Form : Symbol(Form, Decl(keyofAndIndexedAccess.ts, 516, 1))
1861+
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 520, 11))
1862+
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 521, 34))
1863+
1864+
public set<K extends keyof T>(prop: K, value: T[K]) {
1865+
>set : Symbol(Form.set, Decl(keyofAndIndexedAccess.ts, 521, 73))
1866+
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 523, 15))
1867+
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 520, 11))
1868+
>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 523, 34))
1869+
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 523, 15))
1870+
>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 523, 42))
1871+
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 520, 11))
1872+
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 523, 15))
1873+
1874+
this.childFormFactories[prop](value)
1875+
>this.childFormFactories : Symbol(Form.childFormFactories, Decl(keyofAndIndexedAccess.ts, 520, 15))
1876+
>this : Symbol(Form, Decl(keyofAndIndexedAccess.ts, 516, 1))
1877+
>childFormFactories : Symbol(Form.childFormFactories, Decl(keyofAndIndexedAccess.ts, 520, 15))
1878+
>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 523, 34))
1879+
>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 523, 42))
1880+
}
1881+
}
1882+

tests/baselines/reference/keyofAndIndexedAccess.types

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,3 +2166,41 @@ class B extends A<{ x: number}> {
21662166
}
21672167
}
21682168

2169+
// Repro from #13749
2170+
2171+
class Form<T> {
2172+
>Form : Form<T>
2173+
>T : T
2174+
2175+
private childFormFactories: {[K in keyof T]: (v: T[K]) => Form<T[K]>}
2176+
>childFormFactories : { [K in keyof T]: (v: T[K]) => Form<T[K]>; }
2177+
>K : K
2178+
>T : T
2179+
>v : T[K]
2180+
>T : T
2181+
>K : K
2182+
>Form : Form<T>
2183+
>T : T
2184+
>K : K
2185+
2186+
public set<K extends keyof T>(prop: K, value: T[K]) {
2187+
>set : <K extends keyof T>(prop: K, value: T[K]) => void
2188+
>K : K
2189+
>T : T
2190+
>prop : K
2191+
>K : K
2192+
>value : T[K]
2193+
>T : T
2194+
>K : K
2195+
2196+
this.childFormFactories[prop](value)
2197+
>this.childFormFactories[prop](value) : Form<T[K]>
2198+
>this.childFormFactories[prop] : (v: T[K]) => Form<T[K]>
2199+
>this.childFormFactories : { [K in keyof T]: (v: T[K]) => Form<T[K]>; }
2200+
>this : this
2201+
>childFormFactories : { [K in keyof T]: (v: T[K]) => Form<T[K]>; }
2202+
>prop : K
2203+
>value : T[K]
2204+
}
2205+
}
2206+

0 commit comments

Comments
 (0)