Skip to content

Commit fb32b83

Browse files
committed
Add missing test change
1 parent d9c56f2 commit fb32b83

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterConstModifiers.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,27 @@ type NotEmptyMapped<T extends Record<string, any>> = keyof T extends never ? nev
100100
const thingMapped = <const O extends Record<string, any>>(o: NotEmptyMapped<O>) => o;
101101

102102
const tMapped = thingMapped({ foo: '' }); // { foo: "" }
103+
104+
// repro from https://github.com/microsoft/TypeScript/issues/55033
105+
106+
function factory_55033_minimal<const T extends readonly unknown[]>(cb: (...args: T) => void) {
107+
return {} as T
108+
}
109+
110+
const test_55033_minimal = factory_55033_minimal((b: string) => {})
111+
112+
function factory_55033<const T extends readonly unknown[]>(cb: (...args: T) => void) {
113+
return function call<const K extends T>(...args: K): K {
114+
return {} as K;
115+
};
116+
}
117+
118+
const t1_55033 = factory_55033((a: { test: number }, b: string) => {})(
119+
{ test: 123 },
120+
"some string"
121+
);
122+
123+
const t2_55033 = factory_55033((a: { test: number }, b: string) => {})(
124+
{ test: 123 } as const,
125+
"some string"
126+
);

0 commit comments

Comments
 (0)