mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-08 12:55:49 -05:00
Add test for proper tuple type handling
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ type A = | string;
|
||||
type B =
|
||||
| { type: "INCREMENT" }
|
||||
| { type: "DECREMENT" };
|
||||
|
||||
type C = [| 0 | 1, | "foo" | "bar"];
|
||||
|
||||
|
||||
//// [unionTypeWithLeadingOperator.js]
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
@@ -11,3 +11,6 @@ type B =
|
||||
| { type: "DECREMENT" };
|
||||
>type : "DECREMENT"
|
||||
|
||||
type C = [| 0 | 1, | "foo" | "bar"];
|
||||
>C : [0 | 1, "foo" | "bar"]
|
||||
|
||||
|
||||
@@ -2,3 +2,5 @@ type A = & string;
|
||||
type B =
|
||||
& { foo: string }
|
||||
& { bar: number };
|
||||
|
||||
type C = [& { foo: 1 } & { bar: 2 }, & { foo: 3 } & { bar: 4 }];
|
||||
|
||||
@@ -2,3 +2,5 @@ type A = | string;
|
||||
type B =
|
||||
| { type: "INCREMENT" }
|
||||
| { type: "DECREMENT" };
|
||||
|
||||
type C = [| 0 | 1, | "foo" | "bar"];
|
||||
|
||||
Reference in New Issue
Block a user