-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Revert "Fixed apparent type of homomorphic mapped type with non-homomorphic instantiation (#56727)" and add test #57092
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
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
92 changes: 0 additions & 92 deletions
92
...selines/reference/homomorphicMappedTypeWithNonHomomorphicInstantiationSpreadable1.symbols
This file was deleted.
Oops, something went wrong.
95 changes: 0 additions & 95 deletions
95
...baselines/reference/homomorphicMappedTypeWithNonHomomorphicInstantiationSpreadable1.types
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
tests/baselines/reference/nestedHomomorphicMappedTypesWithArrayConstraint1.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,28 @@ | ||
//// [tests/cases/compiler/nestedHomomorphicMappedTypesWithArrayConstraint1.ts] //// | ||
|
||
=== nestedHomomorphicMappedTypesWithArrayConstraint1.ts === | ||
// Based on @types/sinon v10 | ||
|
||
type MatchArguments<T> = { | ||
>MatchArguments : Symbol(MatchArguments, Decl(nestedHomomorphicMappedTypesWithArrayConstraint1.ts, 0, 0)) | ||
>T : Symbol(T, Decl(nestedHomomorphicMappedTypesWithArrayConstraint1.ts, 2, 20)) | ||
|
||
[K in keyof T]: T[K]; | ||
>K : Symbol(K, Decl(nestedHomomorphicMappedTypesWithArrayConstraint1.ts, 3, 5)) | ||
>T : Symbol(T, Decl(nestedHomomorphicMappedTypesWithArrayConstraint1.ts, 2, 20)) | ||
>T : Symbol(T, Decl(nestedHomomorphicMappedTypesWithArrayConstraint1.ts, 2, 20)) | ||
>K : Symbol(K, Decl(nestedHomomorphicMappedTypesWithArrayConstraint1.ts, 3, 5)) | ||
|
||
}; | ||
|
||
interface SinonSpyCallApi<TArgs extends any[] = any[]> { | ||
>SinonSpyCallApi : Symbol(SinonSpyCallApi, Decl(nestedHomomorphicMappedTypesWithArrayConstraint1.ts, 4, 2)) | ||
>TArgs : Symbol(TArgs, Decl(nestedHomomorphicMappedTypesWithArrayConstraint1.ts, 6, 26)) | ||
|
||
calledWith(...args: Partial<MatchArguments<TArgs>>): boolean; | ||
>calledWith : Symbol(SinonSpyCallApi.calledWith, Decl(nestedHomomorphicMappedTypesWithArrayConstraint1.ts, 6, 56)) | ||
>args : Symbol(args, Decl(nestedHomomorphicMappedTypesWithArrayConstraint1.ts, 7, 15)) | ||
>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) | ||
>MatchArguments : Symbol(MatchArguments, Decl(nestedHomomorphicMappedTypesWithArrayConstraint1.ts, 0, 0)) | ||
>TArgs : Symbol(TArgs, Decl(nestedHomomorphicMappedTypesWithArrayConstraint1.ts, 6, 26)) | ||
} |
16 changes: 16 additions & 0 deletions
16
tests/baselines/reference/nestedHomomorphicMappedTypesWithArrayConstraint1.types
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,16 @@ | ||
//// [tests/cases/compiler/nestedHomomorphicMappedTypesWithArrayConstraint1.ts] //// | ||
|
||
=== nestedHomomorphicMappedTypesWithArrayConstraint1.ts === | ||
// Based on @types/sinon v10 | ||
|
||
type MatchArguments<T> = { | ||
>MatchArguments : MatchArguments<T> | ||
|
||
[K in keyof T]: T[K]; | ||
}; | ||
|
||
interface SinonSpyCallApi<TArgs extends any[] = any[]> { | ||
calledWith(...args: Partial<MatchArguments<TArgs>>): boolean; | ||
>calledWith : (...args: Partial<MatchArguments<TArgs>>) => boolean | ||
>args : Partial<MatchArguments<TArgs>> | ||
} |
42 changes: 0 additions & 42 deletions
42
tests/cases/compiler/homomorphicMappedTypeWithNonHomomorphicInstantiationSpreadable1.ts
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
tests/cases/compiler/nestedHomomorphicMappedTypesWithArrayConstraint1.ts
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,12 @@ | ||
// @strict: true | ||
// @noEmit: true | ||
|
||
// Based on @types/sinon v10 | ||
|
||
type MatchArguments<T> = { | ||
[K in keyof T]: T[K]; | ||
}; | ||
|
||
interface SinonSpyCallApi<TArgs extends any[] = any[]> { | ||
calledWith(...args: Partial<MatchArguments<TArgs>>): boolean; | ||
} |
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.
Perhaps leave this test in?
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.
Isn't it confusing to have tests that are kinda meant to pass but they fail?
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.
Well the fact that the test was added meant that the behavior wasn't tested in the first place. Capturing the behavior and changes over time is useful.
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.
I'll remember to leave the tests in the future.