-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Revert PR #52589 #53280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Revert PR #52589 #53280
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/contextualSignatureInArrayElementLibEs2015.errors.txt
This file contains hidden or 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,18 @@ | ||
tests/cases/compiler/contextualSignatureInArrayElementLibEs2015.ts(8,4): error TS7006: Parameter 'arg' implicitly has an 'any' type. | ||
|
||
|
||
==== tests/cases/compiler/contextualSignatureInArrayElementLibEs2015.ts (1 errors) ==== | ||
// See: https://github.com/microsoft/TypeScript/pull/53280#discussion_r1138684984 | ||
|
||
declare function test( | ||
arg: Record<string, (arg: string) => void> | Array<(arg: number) => void> | ||
): void; | ||
|
||
test([ | ||
(arg) => { | ||
~~~ | ||
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type. | ||
arg; // number | ||
}, | ||
]); | ||
|
27 changes: 27 additions & 0 deletions
27
tests/baselines/reference/contextualSignatureInArrayElementLibEs2015.symbols
This file contains hidden or 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,27 @@ | ||
=== tests/cases/compiler/contextualSignatureInArrayElementLibEs2015.ts === | ||
// See: https://github.com/microsoft/TypeScript/pull/53280#discussion_r1138684984 | ||
|
||
declare function test( | ||
>test : Symbol(test, Decl(contextualSignatureInArrayElementLibEs2015.ts, 0, 0)) | ||
|
||
arg: Record<string, (arg: string) => void> | Array<(arg: number) => void> | ||
>arg : Symbol(arg, Decl(contextualSignatureInArrayElementLibEs2015.ts, 2, 22)) | ||
>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) | ||
>arg : Symbol(arg, Decl(contextualSignatureInArrayElementLibEs2015.ts, 3, 23)) | ||
>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) | ||
>arg : Symbol(arg, Decl(contextualSignatureInArrayElementLibEs2015.ts, 3, 54)) | ||
|
||
): void; | ||
|
||
test([ | ||
>test : Symbol(test, Decl(contextualSignatureInArrayElementLibEs2015.ts, 0, 0)) | ||
|
||
(arg) => { | ||
>arg : Symbol(arg, Decl(contextualSignatureInArrayElementLibEs2015.ts, 7, 3)) | ||
|
||
arg; // number | ||
>arg : Symbol(arg, Decl(contextualSignatureInArrayElementLibEs2015.ts, 7, 3)) | ||
|
||
}, | ||
]); | ||
|
This file contains hidden or 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
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/contextualSignatureInArrayElementLibEs5.errors.txt
This file contains hidden or 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,18 @@ | ||
tests/cases/compiler/contextualSignatureInArrayElementLibEs5.ts(8,4): error TS7006: Parameter 'arg' implicitly has an 'any' type. | ||
|
||
|
||
==== tests/cases/compiler/contextualSignatureInArrayElementLibEs5.ts (1 errors) ==== | ||
// See: https://github.com/microsoft/TypeScript/pull/53280#discussion_r1138684984 | ||
|
||
declare function test( | ||
arg: Record<string, (arg: string) => void> | Array<(arg: number) => void> | ||
): void; | ||
|
||
test([ | ||
(arg) => { | ||
~~~ | ||
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type. | ||
arg; // number | ||
}, | ||
]); | ||
|
27 changes: 27 additions & 0 deletions
27
tests/baselines/reference/contextualSignatureInArrayElementLibEs5.symbols
This file contains hidden or 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,27 @@ | ||
=== tests/cases/compiler/contextualSignatureInArrayElementLibEs5.ts === | ||
// See: https://github.com/microsoft/TypeScript/pull/53280#discussion_r1138684984 | ||
|
||
declare function test( | ||
>test : Symbol(test, Decl(contextualSignatureInArrayElementLibEs5.ts, 0, 0)) | ||
|
||
arg: Record<string, (arg: string) => void> | Array<(arg: number) => void> | ||
>arg : Symbol(arg, Decl(contextualSignatureInArrayElementLibEs5.ts, 2, 22)) | ||
>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) | ||
>arg : Symbol(arg, Decl(contextualSignatureInArrayElementLibEs5.ts, 3, 23)) | ||
>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
>arg : Symbol(arg, Decl(contextualSignatureInArrayElementLibEs5.ts, 3, 54)) | ||
|
||
): void; | ||
|
||
test([ | ||
>test : Symbol(test, Decl(contextualSignatureInArrayElementLibEs5.ts, 0, 0)) | ||
|
||
(arg) => { | ||
>arg : Symbol(arg, Decl(contextualSignatureInArrayElementLibEs5.ts, 7, 3)) | ||
|
||
arg; // number | ||
>arg : Symbol(arg, Decl(contextualSignatureInArrayElementLibEs5.ts, 7, 3)) | ||
|
||
}, | ||
]); | ||
|
This file contains hidden or 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
27 changes: 0 additions & 27 deletions
27
...lines/reference/contextualSignatureInArrayElementPrefersArrayUnionMemberLibEs2015.symbols
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
...aselines/reference/contextualSignatureInArrayElementPrefersArrayUnionMemberLibEs5.symbols
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
// @lib: es2015 | ||
|
||
function f<T extends { "0": (p1: number) => number }>(p: T): T { | ||
return p; | ||
} | ||
|
||
var v = f([x => x]); | ||
var v = f([x => x]); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I have no idea why anybody would like to write this code... ok 😅 this is definitely valid 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pattern definitely occurs in real world code, though most of it probably pre-dates our support for tuples.