Skip to content

Commit a7f9d73

Browse files
author
Kanchalai Tanglertsampan
committed
Add tests and baselines
1 parent 7945eb6 commit a7f9d73

4 files changed

+62
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//// [declarationEmitTypeAliasWithTypeParameters1.ts]
2+
3+
export type Bar<X, Y> = () => [X, Y];
4+
export type Foo<Y> = Bar<any, Y>;
5+
export const y = (x: Foo<string>) => 1
6+
7+
//// [declarationEmitTypeAliasWithTypeParameters1.js]
8+
"use strict";
9+
exports.y = function (x) { return 1; };
10+
11+
12+
//// [declarationEmitTypeAliasWithTypeParameters1.d.ts]
13+
export declare type Bar<X, Y> = () => [X, Y];
14+
export declare type Foo<Y> = Bar<any, Y>;
15+
export declare const y: (x: () => [any, string]) => number;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
=== tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters1.ts ===
2+
3+
export type Bar<X, Y> = () => [X, Y];
4+
>Bar : Symbol(Bar, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 0, 0))
5+
>X : Symbol(X, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 1, 16))
6+
>Y : Symbol(Y, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 1, 18))
7+
>X : Symbol(X, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 1, 16))
8+
>Y : Symbol(Y, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 1, 18))
9+
10+
export type Foo<Y> = Bar<any, Y>;
11+
>Foo : Symbol(Foo, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 1, 37))
12+
>Y : Symbol(Y, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 2, 16))
13+
>Bar : Symbol(Bar, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 0, 0))
14+
>Y : Symbol(Y, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 2, 16))
15+
16+
export const y = (x: Foo<string>) => 1
17+
>y : Symbol(y, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 3, 12))
18+
>x : Symbol(x, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 3, 18))
19+
>Foo : Symbol(Foo, Decl(declarationEmitTypeAliasWithTypeParameters1.ts, 1, 37))
20+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
=== tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters1.ts ===
2+
3+
export type Bar<X, Y> = () => [X, Y];
4+
>Bar : Bar<X, Y>
5+
>X : X
6+
>Y : Y
7+
>X : X
8+
>Y : Y
9+
10+
export type Foo<Y> = Bar<any, Y>;
11+
>Foo : () => [any, Y]
12+
>Y : Y
13+
>Bar : Bar<X, Y>
14+
>Y : Y
15+
16+
export const y = (x: Foo<string>) => 1
17+
>y : (x: () => [any, string]) => number
18+
>(x: Foo<string>) => 1 : (x: () => [any, string]) => number
19+
>x : () => [any, string]
20+
>Foo : () => [any, Y]
21+
>1 : 1
22+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// @declaration: true
2+
3+
export type Bar<X, Y> = () => [X, Y];
4+
export type Foo<Y> = Bar<any, Y>;
5+
export const y = (x: Foo<string>) => 1

0 commit comments

Comments
 (0)