mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-12 01:48:33 -05:00
Add tests and baselines
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
//// [declarationEmitTypeAliasWithTypeParameters1.ts]
|
||||
|
||||
export type Bar<X, Y> = () => [X, Y];
|
||||
export type Foo<Y> = Bar<any, Y>;
|
||||
export const y = (x: Foo<string>) => 1
|
||||
|
||||
//// [declarationEmitTypeAliasWithTypeParameters1.js]
|
||||
"use strict";
|
||||
exports.y = function (x) { return 1; };
|
||||
|
||||
|
||||
//// [declarationEmitTypeAliasWithTypeParameters1.d.ts]
|
||||
export declare type Bar<X, Y> = () => [X, Y];
|
||||
export declare type Foo<Y> = Bar<any, Y>;
|
||||
export declare const y: (x: () => [any, string]) => number;
|
||||
@@ -0,0 +1,20 @@
|
||||
=== tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters1.ts ===
|
||||
|
||||
export type Bar<X, Y> = () => [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<Y> = Bar<any, Y>;
|
||||
>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<string>) => 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))
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
=== tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters1.ts ===
|
||||
|
||||
export type Bar<X, Y> = () => [X, Y];
|
||||
>Bar : Bar<X, Y>
|
||||
>X : X
|
||||
>Y : Y
|
||||
>X : X
|
||||
>Y : Y
|
||||
|
||||
export type Foo<Y> = Bar<any, Y>;
|
||||
>Foo : () => [any, Y]
|
||||
>Y : Y
|
||||
>Bar : Bar<X, Y>
|
||||
>Y : Y
|
||||
|
||||
export const y = (x: Foo<string>) => 1
|
||||
>y : (x: () => [any, string]) => number
|
||||
>(x: Foo<string>) => 1 : (x: () => [any, string]) => number
|
||||
>x : () => [any, string]
|
||||
>Foo : () => [any, Y]
|
||||
>1 : 1
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
// @declaration: true
|
||||
|
||||
export type Bar<X, Y> = () => [X, Y];
|
||||
export type Foo<Y> = Bar<any, Y>;
|
||||
export const y = (x: Foo<string>) => 1
|
||||
Reference in New Issue
Block a user