Skip to content

Commit

Permalink
Accept new baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed May 22, 2019
1 parent 2fd4aae commit b7012b5
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/baselines/reference/keyofAndIndexedAccess2.errors.txt
Expand Up @@ -228,4 +228,14 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(108,5): error TS23
this["a"] = "b";
}
}

// Repro from #31385

type Foo<T> = { [key: string]: { [K in keyof T]: K }[keyof T] };

type Bar<T> = { [key: string]: { [K in keyof T]: [K] }[keyof T] };

type Baz<T, Q extends Foo<T>> = { [K in keyof Q]: T[Q[K]] };

type Qux<T, Q extends Bar<T>> = { [K in keyof Q]: T[Q[K]["0"]] };

10 changes: 10 additions & 0 deletions tests/baselines/reference/keyofAndIndexedAccess2.js
Expand Up @@ -145,6 +145,16 @@ export class c {
this["a"] = "b";
}
}

// Repro from #31385

type Foo<T> = { [key: string]: { [K in keyof T]: K }[keyof T] };

type Bar<T> = { [key: string]: { [K in keyof T]: [K] }[keyof T] };

type Baz<T, Q extends Foo<T>> = { [K in keyof Q]: T[Q[K]] };

type Qux<T, Q extends Bar<T>> = { [K in keyof Q]: T[Q[K]["0"]] };


//// [keyofAndIndexedAccess2.js]
Expand Down
44 changes: 44 additions & 0 deletions tests/baselines/reference/keyofAndIndexedAccess2.symbols
Expand Up @@ -517,3 +517,47 @@ export class c {
}
}

// Repro from #31385

type Foo<T> = { [key: string]: { [K in keyof T]: K }[keyof T] };
>Foo : Symbol(Foo, Decl(keyofAndIndexedAccess2.ts, 145, 1))
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 149, 9))
>key : Symbol(key, Decl(keyofAndIndexedAccess2.ts, 149, 17))
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 149, 34))
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 149, 9))
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 149, 34))
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 149, 9))

type Bar<T> = { [key: string]: { [K in keyof T]: [K] }[keyof T] };
>Bar : Symbol(Bar, Decl(keyofAndIndexedAccess2.ts, 149, 64))
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 151, 9))
>key : Symbol(key, Decl(keyofAndIndexedAccess2.ts, 151, 17))
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 151, 34))
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 151, 9))
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 151, 34))
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 151, 9))

type Baz<T, Q extends Foo<T>> = { [K in keyof Q]: T[Q[K]] };
>Baz : Symbol(Baz, Decl(keyofAndIndexedAccess2.ts, 151, 66))
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 153, 9))
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 153, 11))
>Foo : Symbol(Foo, Decl(keyofAndIndexedAccess2.ts, 145, 1))
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 153, 9))
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 153, 35))
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 153, 11))
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 153, 9))
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 153, 11))
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 153, 35))

type Qux<T, Q extends Bar<T>> = { [K in keyof Q]: T[Q[K]["0"]] };
>Qux : Symbol(Qux, Decl(keyofAndIndexedAccess2.ts, 153, 60))
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 155, 9))
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 155, 11))
>Bar : Symbol(Bar, Decl(keyofAndIndexedAccess2.ts, 149, 64))
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 155, 9))
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 155, 35))
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 155, 11))
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 155, 9))
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 155, 11))
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 155, 35))

16 changes: 16 additions & 0 deletions tests/baselines/reference/keyofAndIndexedAccess2.types
Expand Up @@ -517,3 +517,19 @@ export class c {
}
}

// Repro from #31385

type Foo<T> = { [key: string]: { [K in keyof T]: K }[keyof T] };
>Foo : Foo<T>
>key : string

type Bar<T> = { [key: string]: { [K in keyof T]: [K] }[keyof T] };
>Bar : Bar<T>
>key : string

type Baz<T, Q extends Foo<T>> = { [K in keyof Q]: T[Q[K]] };
>Baz : Baz<T, Q>

type Qux<T, Q extends Bar<T>> = { [K in keyof Q]: T[Q[K]["0"]] };
>Qux : Qux<T, Q>

0 comments on commit b7012b5

Please sign in to comment.