Test:correct parens around keyof in decl emit
This commit is contained in:
parent
43d47de74d
commit
2d2ac6794f
25
tests/baselines/reference/declarationEmitIndexTypeArray.js
Normal file
25
tests/baselines/reference/declarationEmitIndexTypeArray.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
//// [declarationEmitIndexTypeArray.ts]
|
||||
function doSomethingWithKeys<T>(...keys: (keyof T)[]) { }
|
||||
|
||||
const utilityFunctions = {
|
||||
doSomethingWithKeys
|
||||
};
|
||||
|
||||
|
||||
//// [declarationEmitIndexTypeArray.js]
|
||||
function doSomethingWithKeys() {
|
||||
var keys = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
keys[_i] = arguments[_i];
|
||||
}
|
||||
}
|
||||
var utilityFunctions = {
|
||||
doSomethingWithKeys: doSomethingWithKeys
|
||||
};
|
||||
|
||||
|
||||
//// [declarationEmitIndexTypeArray.d.ts]
|
||||
declare function doSomethingWithKeys<T>(...keys: (keyof T)[]): void;
|
||||
declare const utilityFunctions: {
|
||||
doSomethingWithKeys: <T>(...keys: (keyof T)[]) => void;
|
||||
};
|
|
@ -0,0 +1,15 @@
|
|||
=== tests/cases/compiler/declarationEmitIndexTypeArray.ts ===
|
||||
function doSomethingWithKeys<T>(...keys: (keyof T)[]) { }
|
||||
>doSomethingWithKeys : Symbol(doSomethingWithKeys, Decl(declarationEmitIndexTypeArray.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(declarationEmitIndexTypeArray.ts, 0, 29))
|
||||
>keys : Symbol(keys, Decl(declarationEmitIndexTypeArray.ts, 0, 32))
|
||||
>T : Symbol(T, Decl(declarationEmitIndexTypeArray.ts, 0, 29))
|
||||
|
||||
const utilityFunctions = {
|
||||
>utilityFunctions : Symbol(utilityFunctions, Decl(declarationEmitIndexTypeArray.ts, 2, 5))
|
||||
|
||||
doSomethingWithKeys
|
||||
>doSomethingWithKeys : Symbol(doSomethingWithKeys, Decl(declarationEmitIndexTypeArray.ts, 2, 26))
|
||||
|
||||
};
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
=== tests/cases/compiler/declarationEmitIndexTypeArray.ts ===
|
||||
function doSomethingWithKeys<T>(...keys: (keyof T)[]) { }
|
||||
>doSomethingWithKeys : <T>(...keys: keyof T[]) => void
|
||||
>T : T
|
||||
>keys : keyof T[]
|
||||
>T : T
|
||||
|
||||
const utilityFunctions = {
|
||||
>utilityFunctions : { doSomethingWithKeys: <T>(...keys: keyof T[]) => void; }
|
||||
>{ doSomethingWithKeys} : { doSomethingWithKeys: <T>(...keys: keyof T[]) => void; }
|
||||
|
||||
doSomethingWithKeys
|
||||
>doSomethingWithKeys : <T>(...keys: keyof T[]) => void
|
||||
|
||||
};
|
||||
|
6
tests/cases/compiler/declarationEmitIndexTypeArray.ts
Normal file
6
tests/cases/compiler/declarationEmitIndexTypeArray.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
// @declaration: true
|
||||
function doSomethingWithKeys<T>(...keys: (keyof T)[]) { }
|
||||
|
||||
const utilityFunctions = {
|
||||
doSomethingWithKeys
|
||||
};
|
Loading…
Reference in a new issue