Add test for proper tuple type handling

This commit is contained in:
Marius Schulz
2016-11-20 22:26:32 +01:00
parent cd70f22b88
commit d040db42f5
8 changed files with 28 additions and 0 deletions

View File

@@ -3,6 +3,8 @@ type A = & string;
type B =
& { foo: string }
& { bar: number };
type C = [& { foo: 1 } & { bar: 2 }, & { foo: 3 } & { bar: 4 }];
//// [intersectionTypeWithLeadingOperator.js]

View File

@@ -11,3 +11,10 @@ type B =
& { bar: number };
>bar : Symbol(bar, Decl(intersectionTypeWithLeadingOperator.ts, 3, 5))
type C = [& { foo: 1 } & { bar: 2 }, & { foo: 3 } & { bar: 4 }];
>C : Symbol(C, Decl(intersectionTypeWithLeadingOperator.ts, 3, 20))
>foo : Symbol(foo, Decl(intersectionTypeWithLeadingOperator.ts, 5, 13))
>bar : Symbol(bar, Decl(intersectionTypeWithLeadingOperator.ts, 5, 26))
>foo : Symbol(foo, Decl(intersectionTypeWithLeadingOperator.ts, 5, 40))
>bar : Symbol(bar, Decl(intersectionTypeWithLeadingOperator.ts, 5, 53))

View File

@@ -11,3 +11,10 @@ type B =
& { bar: number };
>bar : number
type C = [& { foo: 1 } & { bar: 2 }, & { foo: 3 } & { bar: 4 }];
>C : [{ foo: 1; } & { bar: 2; }, { foo: 3; } & { bar: 4; }]
>foo : 1
>bar : 2
>foo : 3
>bar : 4

View File

@@ -3,6 +3,8 @@ type A = | string;
type B =
| { type: "INCREMENT" }
| { type: "DECREMENT" };
type C = [| 0 | 1, | "foo" | "bar"];
//// [unionTypeWithLeadingOperator.js]

View File

@@ -11,3 +11,6 @@ type B =
| { type: "DECREMENT" };
>type : Symbol(type, Decl(unionTypeWithLeadingOperator.ts, 3, 5))
type C = [| 0 | 1, | "foo" | "bar"];
>C : Symbol(C, Decl(unionTypeWithLeadingOperator.ts, 3, 26))

View File

@@ -11,3 +11,6 @@ type B =
| { type: "DECREMENT" };
>type : "DECREMENT"
type C = [| 0 | 1, | "foo" | "bar"];
>C : [0 | 1, "foo" | "bar"]

View File

@@ -2,3 +2,5 @@ type A = & string;
type B =
& { foo: string }
& { bar: number };
type C = [& { foo: 1 } & { bar: 2 }, & { foo: 3 } & { bar: 4 }];

View File

@@ -2,3 +2,5 @@ type A = | string;
type B =
| { type: "INCREMENT" }
| { type: "DECREMENT" };
type C = [| 0 | 1, | "foo" | "bar"];