mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
Add tests
This commit is contained in:
parent
dc501f47c2
commit
a4864d086e
13
tests/cases/compiler/declarationEmitInferedTypeAlias1.ts
Normal file
13
tests/cases/compiler/declarationEmitInferedTypeAlias1.ts
Normal file
@ -0,0 +1,13 @@
|
||||
// @declaration: true
|
||||
// @skipDefaultLibCheck: true
|
||||
|
||||
// @Filename: 0.ts
|
||||
{
|
||||
type Data = string | boolean;
|
||||
let obj: Data = true;
|
||||
}
|
||||
export { }
|
||||
|
||||
// @Filename: 1.ts
|
||||
let v = "str" || true;
|
||||
export { v }
|
||||
16
tests/cases/compiler/declarationEmitInferedTypeAlias2.ts
Normal file
16
tests/cases/compiler/declarationEmitInferedTypeAlias2.ts
Normal file
@ -0,0 +1,16 @@
|
||||
// @declaration: true
|
||||
// @skipDefaultLibCheck: true
|
||||
|
||||
// @Filename: 0.ts
|
||||
{
|
||||
type Data = string | boolean;
|
||||
let obj: Data = true;
|
||||
}
|
||||
export { }
|
||||
|
||||
// @Filename: 1.ts
|
||||
let v = "str" || true;
|
||||
function bar () {
|
||||
return v;
|
||||
}
|
||||
export { v, bar }
|
||||
13
tests/cases/compiler/declarationEmitInferedTypeAlias3.ts
Normal file
13
tests/cases/compiler/declarationEmitInferedTypeAlias3.ts
Normal file
@ -0,0 +1,13 @@
|
||||
// @declaration: true
|
||||
// @skipDefaultLibCheck: true
|
||||
|
||||
// @Filename: 0.ts
|
||||
{
|
||||
type Data = string | boolean;
|
||||
let obj: Data = true;
|
||||
}
|
||||
export { }
|
||||
|
||||
// @Filename: 1.ts
|
||||
var x = "hi" || 5;
|
||||
export default x;
|
||||
7
tests/cases/compiler/declarationEmitInferedTypeAlias4.ts
Normal file
7
tests/cases/compiler/declarationEmitInferedTypeAlias4.ts
Normal file
@ -0,0 +1,7 @@
|
||||
// @declaration: true
|
||||
|
||||
function f<A>() {
|
||||
type Foo<T> = T | { x: Foo<T> };
|
||||
var x: Foo<A[]>;
|
||||
return x;
|
||||
}
|
||||
12
tests/cases/compiler/declarationEmitInferedTypeAlias5.ts
Normal file
12
tests/cases/compiler/declarationEmitInferedTypeAlias5.ts
Normal file
@ -0,0 +1,12 @@
|
||||
// @declaration: true
|
||||
// @skipDefaultLibCheck: true
|
||||
|
||||
// @Filename: 0.ts
|
||||
export type Data = string | boolean;
|
||||
let obj: Data = true;
|
||||
|
||||
// @Filename: 1.ts
|
||||
import * as Z from "./0"
|
||||
//let v2: Z.Data;
|
||||
let v = "str" || true;
|
||||
export { v }
|
||||
13
tests/cases/compiler/declarationEmitInferedTypeAlias6.ts
Normal file
13
tests/cases/compiler/declarationEmitInferedTypeAlias6.ts
Normal file
@ -0,0 +1,13 @@
|
||||
// @declaration: true
|
||||
// @skipDefaultLibCheck: true
|
||||
|
||||
// @Filename: 0.ts
|
||||
{
|
||||
type Data = string | boolean;
|
||||
let obj: Data = true;
|
||||
}
|
||||
export { }
|
||||
|
||||
// @Filename: 1.ts
|
||||
let v = "str" || true;
|
||||
export { v }
|
||||
10
tests/cases/compiler/declarationEmitInferedTypeAlias7.ts
Normal file
10
tests/cases/compiler/declarationEmitInferedTypeAlias7.ts
Normal file
@ -0,0 +1,10 @@
|
||||
// @declaration: true
|
||||
// @skipDefaultLibCheck: true
|
||||
|
||||
// @Filename: 0.ts
|
||||
export type Data = string | boolean;
|
||||
let obj: Data = true;
|
||||
|
||||
// @Filename: 1.ts
|
||||
let v = "str" || true;
|
||||
export { v }
|
||||
8
tests/cases/compiler/declarationEmitInferedTypeAlias8.ts
Normal file
8
tests/cases/compiler/declarationEmitInferedTypeAlias8.ts
Normal file
@ -0,0 +1,8 @@
|
||||
// @declaration: true
|
||||
|
||||
type Foo<T> = T | { x: Foo<T> };
|
||||
var x: Foo<number[]>;
|
||||
|
||||
function returnSomeGlobalValue() {
|
||||
return x;
|
||||
}
|
||||
8
tests/cases/compiler/declarationEmitInferedTypeAlias9.ts
Normal file
8
tests/cases/compiler/declarationEmitInferedTypeAlias9.ts
Normal file
@ -0,0 +1,8 @@
|
||||
// @declaration: true
|
||||
|
||||
type Foo<T> = T | { x: Foo<T> };
|
||||
var x: Foo<number[]>;
|
||||
|
||||
export function returnSomeGlobalValue() {
|
||||
return x;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user