diff --git a/tests/baselines/reference/declarationEmitIndexTypeArray.js b/tests/baselines/reference/declarationEmitIndexTypeArray.js new file mode 100644 index 00000000000..a84080fb5c4 --- /dev/null +++ b/tests/baselines/reference/declarationEmitIndexTypeArray.js @@ -0,0 +1,25 @@ +//// [declarationEmitIndexTypeArray.ts] +function doSomethingWithKeys(...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(...keys: (keyof T)[]): void; +declare const utilityFunctions: { + doSomethingWithKeys: (...keys: (keyof T)[]) => void; +}; diff --git a/tests/baselines/reference/declarationEmitIndexTypeArray.symbols b/tests/baselines/reference/declarationEmitIndexTypeArray.symbols new file mode 100644 index 00000000000..1f6cb302881 --- /dev/null +++ b/tests/baselines/reference/declarationEmitIndexTypeArray.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/declarationEmitIndexTypeArray.ts === +function doSomethingWithKeys(...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)) + +}; + diff --git a/tests/baselines/reference/declarationEmitIndexTypeArray.types b/tests/baselines/reference/declarationEmitIndexTypeArray.types new file mode 100644 index 00000000000..67f8905639e --- /dev/null +++ b/tests/baselines/reference/declarationEmitIndexTypeArray.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/declarationEmitIndexTypeArray.ts === +function doSomethingWithKeys(...keys: (keyof T)[]) { } +>doSomethingWithKeys : (...keys: keyof T[]) => void +>T : T +>keys : keyof T[] +>T : T + +const utilityFunctions = { +>utilityFunctions : { doSomethingWithKeys: (...keys: keyof T[]) => void; } +>{ doSomethingWithKeys} : { doSomethingWithKeys: (...keys: keyof T[]) => void; } + + doSomethingWithKeys +>doSomethingWithKeys : (...keys: keyof T[]) => void + +}; + diff --git a/tests/cases/compiler/declarationEmitIndexTypeArray.ts b/tests/cases/compiler/declarationEmitIndexTypeArray.ts new file mode 100644 index 00000000000..be80413aa63 --- /dev/null +++ b/tests/cases/compiler/declarationEmitIndexTypeArray.ts @@ -0,0 +1,6 @@ +// @declaration: true +function doSomethingWithKeys(...keys: (keyof T)[]) { } + +const utilityFunctions = { + doSomethingWithKeys +};