Accept new baselines

This commit is contained in:
Anders Hejlsberg
2018-05-08 09:42:26 -07:00
parent 238177657f
commit 14e3e39237
3 changed files with 59 additions and 0 deletions

View File

@@ -627,6 +627,14 @@ class Unbounded<T> {
let y: {} | undefined | null = x;
}
}
// Repro from #23940
interface I7 {
x: any;
}
type Foo7<T extends number> = T;
declare function f7<K extends keyof I7>(type: K): Foo7<I7[K]>;
//// [keyofAndIndexedAccess.js]
@@ -1368,3 +1376,8 @@ declare function fn<T extends I, K extends keyof T>(o: T, k: K): void;
declare class Unbounded<T> {
foo(x: T[keyof T]): void;
}
interface I7 {
x: any;
}
declare type Foo7<T extends number> = T;
declare function f7<K extends keyof I7>(type: K): Foo7<I7[K]>;

View File

@@ -2235,3 +2235,26 @@ class Unbounded<T> {
}
}
// Repro from #23940
interface I7 {
>I7 : Symbol(I7, Decl(keyofAndIndexedAccess.ts, 627, 1))
x: any;
>x : Symbol(I7.x, Decl(keyofAndIndexedAccess.ts, 631, 14))
}
type Foo7<T extends number> = T;
>Foo7 : Symbol(Foo7, Decl(keyofAndIndexedAccess.ts, 633, 1))
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 634, 10))
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 634, 10))
declare function f7<K extends keyof I7>(type: K): Foo7<I7[K]>;
>f7 : Symbol(f7, Decl(keyofAndIndexedAccess.ts, 634, 32))
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 635, 20))
>I7 : Symbol(I7, Decl(keyofAndIndexedAccess.ts, 627, 1))
>type : Symbol(type, Decl(keyofAndIndexedAccess.ts, 635, 40))
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 635, 20))
>Foo7 : Symbol(Foo7, Decl(keyofAndIndexedAccess.ts, 633, 1))
>I7 : Symbol(I7, Decl(keyofAndIndexedAccess.ts, 627, 1))
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 635, 20))

View File

@@ -2591,3 +2591,26 @@ class Unbounded<T> {
}
}
// Repro from #23940
interface I7 {
>I7 : I7
x: any;
>x : any
}
type Foo7<T extends number> = T;
>Foo7 : T
>T : T
>T : T
declare function f7<K extends keyof I7>(type: K): Foo7<I7[K]>;
>f7 : <K extends "x">(type: K) => I7[K]
>K : K
>I7 : I7
>type : K
>K : K
>Foo7 : T
>I7 : I7
>K : K