-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12386 from mariusschulz/union-and-intersection-ty…
…pes-with-leading-operator Union and intersection types with leading operator
- Loading branch information
Showing
9 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/intersectionTypeWithLeadingOperator.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//// [intersectionTypeWithLeadingOperator.ts] | ||
type A = & string; | ||
type B = | ||
& { foo: string } | ||
& { bar: number }; | ||
|
||
type C = [& { foo: 1 } & { bar: 2 }, & { foo: 3 } & { bar: 4 }]; | ||
|
||
|
||
//// [intersectionTypeWithLeadingOperator.js] |
20 changes: 20 additions & 0 deletions
20
tests/baselines/reference/intersectionTypeWithLeadingOperator.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
=== tests/cases/compiler/intersectionTypeWithLeadingOperator.ts === | ||
type A = & string; | ||
>A : Symbol(A, Decl(intersectionTypeWithLeadingOperator.ts, 0, 0)) | ||
|
||
type B = | ||
>B : Symbol(B, Decl(intersectionTypeWithLeadingOperator.ts, 0, 18)) | ||
|
||
& { foo: string } | ||
>foo : Symbol(foo, Decl(intersectionTypeWithLeadingOperator.ts, 2, 5)) | ||
|
||
& { 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)) | ||
|
20 changes: 20 additions & 0 deletions
20
tests/baselines/reference/intersectionTypeWithLeadingOperator.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
=== tests/cases/compiler/intersectionTypeWithLeadingOperator.ts === | ||
type A = & string; | ||
>A : string | ||
|
||
type B = | ||
>B : B | ||
|
||
& { foo: string } | ||
>foo : string | ||
|
||
& { 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//// [unionTypeWithLeadingOperator.ts] | ||
type A = | string; | ||
type B = | ||
| { type: "INCREMENT" } | ||
| { type: "DECREMENT" }; | ||
|
||
type C = [| 0 | 1, | "foo" | "bar"]; | ||
|
||
|
||
//// [unionTypeWithLeadingOperator.js] |
16 changes: 16 additions & 0 deletions
16
tests/baselines/reference/unionTypeWithLeadingOperator.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
=== tests/cases/compiler/unionTypeWithLeadingOperator.ts === | ||
type A = | string; | ||
>A : Symbol(A, Decl(unionTypeWithLeadingOperator.ts, 0, 0)) | ||
|
||
type B = | ||
>B : Symbol(B, Decl(unionTypeWithLeadingOperator.ts, 0, 18)) | ||
|
||
| { type: "INCREMENT" } | ||
>type : Symbol(type, Decl(unionTypeWithLeadingOperator.ts, 2, 5)) | ||
|
||
| { type: "DECREMENT" }; | ||
>type : Symbol(type, Decl(unionTypeWithLeadingOperator.ts, 3, 5)) | ||
|
||
type C = [| 0 | 1, | "foo" | "bar"]; | ||
>C : Symbol(C, Decl(unionTypeWithLeadingOperator.ts, 3, 26)) | ||
|
16 changes: 16 additions & 0 deletions
16
tests/baselines/reference/unionTypeWithLeadingOperator.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
=== tests/cases/compiler/unionTypeWithLeadingOperator.ts === | ||
type A = | string; | ||
>A : string | ||
|
||
type B = | ||
>B : B | ||
|
||
| { type: "INCREMENT" } | ||
>type : "INCREMENT" | ||
|
||
| { type: "DECREMENT" }; | ||
>type : "DECREMENT" | ||
|
||
type C = [| 0 | 1, | "foo" | "bar"]; | ||
>C : [0 | 1, "foo" | "bar"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type A = & string; | ||
type B = | ||
& { foo: string } | ||
& { bar: number }; | ||
|
||
type C = [& { foo: 1 } & { bar: 2 }, & { foo: 3 } & { bar: 4 }]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type A = | string; | ||
type B = | ||
| { type: "INCREMENT" } | ||
| { type: "DECREMENT" }; | ||
|
||
type C = [| 0 | 1, | "foo" | "bar"]; |