-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ts] Support
const
modifier in type parameters (#15384)
- Loading branch information
1 parent
21d7c9d
commit 2f3ef39
Showing
17 changed files
with
2,275 additions
and
87 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
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
32 changes: 32 additions & 0 deletions
32
packages/babel-parser/test/fixtures/typescript/types/const-type-parameters-babel-7/input.ts
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,32 @@ | ||
function a<const T>() {} | ||
function b<const T extends U>() {} | ||
function c<T, const U>() {} | ||
declare function d<const T>(); | ||
<const T>() => {}; | ||
<const T extends U>() => {}; | ||
(function <const T>() {}); | ||
(function <const T extends U>() {}); | ||
(function <T, const U>() {}); | ||
|
||
class A<const T> {} | ||
class B<const T extends U> {} | ||
class C<T, const U> {} | ||
class D<in const T> {} | ||
class E<const in T> {} | ||
(class <const T> {}); | ||
(class <const T extends U> {}); | ||
(class <T, const U> {}); | ||
(class <in const T> {}); | ||
(class <const in T> {}); | ||
|
||
interface I<const T> {} | ||
interface J<const T extends U> {} | ||
interface K<T, const U> {} | ||
interface L<in const T> {} | ||
interface M<const in T> {} | ||
|
||
class _ { | ||
method<const T>() {} | ||
method<const T extends U>() {} | ||
method<T, const U>() {} | ||
} |
3 changes: 3 additions & 0 deletions
3
...es/babel-parser/test/fixtures/typescript/types/const-type-parameters-babel-7/options.json
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,3 @@ | ||
{ | ||
"BABEL_8_BREAKING": false | ||
} |
Oops, something went wrong.