diff --git a/tests/baselines/reference/declarationEmitTypeAliasWithTypeParameters1.js b/tests/baselines/reference/declarationEmitTypeAliasWithTypeParameters1.js new file mode 100644 index 00000000000..c41c4690391 --- /dev/null +++ b/tests/baselines/reference/declarationEmitTypeAliasWithTypeParameters1.js @@ -0,0 +1,15 @@ +//// [declarationEmitTypeAliasWithTypeParameters1.ts] + +export type Bar = () => [X, Y]; +export type Foo = Bar; +export const y = (x: Foo) => 1 + +//// [declarationEmitTypeAliasWithTypeParameters1.js] +"use strict"; +exports.y = function (x) { return 1; }; + + +//// [declarationEmitTypeAliasWithTypeParameters1.d.ts] +export declare type Bar = () => [X, Y]; +export declare type Foo = Bar; +export declare const y: (x: () => [any, string]) => number; diff --git a/tests/baselines/reference/declarationEmitTypeAliasWithTypeParameters1.symbols b/tests/baselines/reference/declarationEmitTypeAliasWithTypeParameters1.symbols new file mode 100644 index 00000000000..fa63e711f9a --- /dev/null +++ b/tests/baselines/reference/declarationEmitTypeAliasWithTypeParameters1.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters1.ts === + +export type Bar = () => [X, Y]; +>Bar : Symbol(Bar, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 0, 0)) +>X : Symbol(X, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 1, 16)) +>Y : Symbol(Y, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 1, 18)) +>X : Symbol(X, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 1, 16)) +>Y : Symbol(Y, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 1, 18)) + +export type Foo = Bar; +>Foo : Symbol(Foo, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 1, 37)) +>Y : Symbol(Y, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 2, 16)) +>Bar : Symbol(Bar, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 0, 0)) +>Y : Symbol(Y, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 2, 16)) + +export const y = (x: Foo) => 1 +>y : Symbol(y, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 3, 12)) +>x : Symbol(x, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 3, 18)) +>Foo : Symbol(Foo, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 1, 37)) + diff --git a/tests/baselines/reference/declarationEmitTypeAliasWithTypeParameters1.types b/tests/baselines/reference/declarationEmitTypeAliasWithTypeParameters1.types new file mode 100644 index 00000000000..3ff9f9bde1d --- /dev/null +++ b/tests/baselines/reference/declarationEmitTypeAliasWithTypeParameters1.types @@ -0,0 +1,22 @@ +=== tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters1.ts === + +export type Bar = () => [X, Y]; +>Bar : Bar +>X : X +>Y : Y +>X : X +>Y : Y + +export type Foo = Bar; +>Foo : () => [any, Y] +>Y : Y +>Bar : Bar +>Y : Y + +export const y = (x: Foo) => 1 +>y : (x: () => [any, string]) => number +>(x: Foo) => 1 : (x: () => [any, string]) => number +>x : () => [any, string] +>Foo : () => [any, Y] +>1 : 1 + diff --git a/tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters1.ts b/tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters1.ts new file mode 100644 index 00000000000..ff9042af699 --- /dev/null +++ b/tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters1.ts @@ -0,0 +1,5 @@ +// @declaration: true + +export type Bar = () => [X, Y]; +export type Foo = Bar; +export const y = (x: Foo) => 1 \ No newline at end of file