|
| 1 | +=== tests/cases/compiler/jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx === |
| 2 | +/// <reference path="react16.d.ts" /> |
| 3 | + |
| 4 | +// repro #51577 |
| 5 | + |
| 6 | +declare function omit<T, K extends string>(names: readonly K[], obj: T): Omit<T, K>; |
| 7 | +>omit : Symbol(omit, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 0, 0), Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 4, 84)) |
| 8 | +>T : Symbol(T, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 4, 22)) |
| 9 | +>K : Symbol(K, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 4, 24)) |
| 10 | +>names : Symbol(names, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 4, 43)) |
| 11 | +>K : Symbol(K, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 4, 24)) |
| 12 | +>obj : Symbol(obj, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 4, 63)) |
| 13 | +>T : Symbol(T, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 4, 22)) |
| 14 | +>Omit : Symbol(Omit, Decl(lib.es5.d.ts, --, --)) |
| 15 | +>T : Symbol(T, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 4, 22)) |
| 16 | +>K : Symbol(K, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 4, 24)) |
| 17 | + |
| 18 | +declare function omit<K extends string>(names: readonly K[]): <T>(obj: T) => Omit<T, K>; |
| 19 | +>omit : Symbol(omit, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 0, 0), Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 4, 84)) |
| 20 | +>K : Symbol(K, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 5, 22)) |
| 21 | +>names : Symbol(names, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 5, 40)) |
| 22 | +>K : Symbol(K, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 5, 22)) |
| 23 | +>T : Symbol(T, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 5, 63)) |
| 24 | +>obj : Symbol(obj, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 5, 66)) |
| 25 | +>T : Symbol(T, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 5, 63)) |
| 26 | +>Omit : Symbol(Omit, Decl(lib.es5.d.ts, --, --)) |
| 27 | +>T : Symbol(T, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 5, 63)) |
| 28 | +>K : Symbol(K, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 5, 22)) |
| 29 | + |
| 30 | +declare const otherProps: { bar: string, qwe: boolean } |
| 31 | +>otherProps : Symbol(otherProps, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 7, 13)) |
| 32 | +>bar : Symbol(bar, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 7, 27)) |
| 33 | +>qwe : Symbol(qwe, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 7, 40)) |
| 34 | + |
| 35 | +declare function GenericComponent<T>(props: T): null |
| 36 | +>GenericComponent : Symbol(GenericComponent, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 7, 55)) |
| 37 | +>T : Symbol(T, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 9, 34)) |
| 38 | +>props : Symbol(props, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 9, 37)) |
| 39 | +>T : Symbol(T, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 9, 34)) |
| 40 | + |
| 41 | +<GenericComponent {...omit(['bar'], otherProps)} />; // no error |
| 42 | +>GenericComponent : Symbol(GenericComponent, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 7, 55)) |
| 43 | +>omit : Symbol(omit, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 0, 0), Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 4, 84)) |
| 44 | +>otherProps : Symbol(otherProps, Decl(jsxGenericComponentWithSpreadingResultOfGenericFunction.tsx, 7, 13)) |
| 45 | + |
| 46 | + |
| 47 | + |
0 commit comments