Use elipses for reverse mapped types in nested positions (#28494)

This commit is contained in:
Wesley Wigham
2018-11-12 18:50:08 -08:00
committed by GitHub
parent d99de73e85
commit 004dc89600
3 changed files with 79 additions and 31 deletions

View File

@@ -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]: ...;
}`);

View 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`);