mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Use elipses for reverse mapped types in nested positions (#28494)
This commit is contained in:
@@ -18,53 +18,53 @@
|
||||
|
||||
verify.quickInfoAt('1', `const out: {
|
||||
a: {
|
||||
a: any;
|
||||
a: ...;
|
||||
};
|
||||
}`);
|
||||
verify.quickInfoAt('2', `function foo<{
|
||||
a: {
|
||||
a: any;
|
||||
a: ...;
|
||||
};
|
||||
}>(deep: Deep<{
|
||||
a: {
|
||||
a: any;
|
||||
a: ...;
|
||||
};
|
||||
}>): {
|
||||
a: {
|
||||
a: any;
|
||||
a: ...;
|
||||
};
|
||||
}`);
|
||||
verify.quickInfoAt('3', `(property) a: {
|
||||
a: {
|
||||
a: any;
|
||||
a: ...;
|
||||
};
|
||||
}`);
|
||||
verify.quickInfoAt('4', `(property) a: {
|
||||
a: {
|
||||
a: any;
|
||||
a: ...;
|
||||
};
|
||||
}`);
|
||||
verify.quickInfoAt('5', `(property) a: {
|
||||
a: {
|
||||
a: any;
|
||||
a: ...;
|
||||
};
|
||||
}`);
|
||||
verify.quickInfoAt('6', `const oub: {
|
||||
[x: string]: any;
|
||||
[x: string]: ...;
|
||||
}`);
|
||||
verify.quickInfoAt('7', `function foo<{
|
||||
[x: string]: any;
|
||||
[x: string]: ...;
|
||||
}>(deep: Deep<{
|
||||
[x: string]: any;
|
||||
[x: string]: ...;
|
||||
}>): {
|
||||
[x: string]: any;
|
||||
[x: string]: ...;
|
||||
}`);
|
||||
verify.quickInfoAt('8', `{
|
||||
[x: string]: any;
|
||||
[x: string]: ...;
|
||||
}`);
|
||||
verify.quickInfoAt('9', `{
|
||||
[x: string]: any;
|
||||
[x: string]: ...;
|
||||
}`);
|
||||
verify.quickInfoAt('10', `{
|
||||
[x: string]: any;
|
||||
[x: string]: ...;
|
||||
}`);
|
||||
|
||||
36
tests/cases/fourslash/reverseMappedTypeQuickInfo.ts
Normal file
36
tests/cases/fourslash/reverseMappedTypeQuickInfo.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////interface IAction {
|
||||
//// type: string;
|
||||
////}
|
||||
////
|
||||
////type Reducer<S> = (state: S, action: IAction) => S
|
||||
////
|
||||
////function combineReducers<S>(reducers: { [K in keyof S]: Reducer<S[K]> }): Reducer<S> {
|
||||
//// const dummy = {} as S;
|
||||
//// return () => dummy;
|
||||
////}
|
||||
////
|
||||
////const test_inner = (test: string, action: IAction) => {
|
||||
//// return 'dummy';
|
||||
////}
|
||||
////const test = combineReducers({
|
||||
//// test_inner
|
||||
////});
|
||||
////
|
||||
////const test_outer = combineReducers({
|
||||
//// test
|
||||
////});
|
||||
////
|
||||
////// '{test: { test_inner: any } }'
|
||||
////type FinalType/*1*/ = ReturnType<typeof test_outer>;
|
||||
////
|
||||
////var k: FinalType;
|
||||
////k.test.test_inner/*2*/
|
||||
|
||||
verify.quickInfoAt("1", `type FinalType = {
|
||||
test: {
|
||||
test_inner: ...;
|
||||
};
|
||||
}`);
|
||||
verify.quickInfoAt("2", `(property) test_inner: string`);
|
||||
Reference in New Issue
Block a user