Accept new baselines

This commit is contained in:
Anders Hejlsberg 2017-01-30 16:57:11 -08:00
parent 647e1836c3
commit 8659101618
3 changed files with 121 additions and 41 deletions

View File

@ -12,26 +12,37 @@ function f2<T>(x: Partial<T>, y: Readonly<T>) {
obj = y;
}
function f3<T>(x: Partial<T>) {
x = {};
}
// Repro from #12900
interface Base {
foo: { [key: string]: any };
bar: any;
baz: any;
foo: { [key: string]: any };
bar: any;
baz: any;
}
interface E1<T> extends Base {
foo: T;
foo: T;
}
interface Something { name: string, value: string };
interface E2 extends Base {
foo: Partial<Something>; // or other mapped type
foo: Partial<Something>; // or other mapped type
}
interface E3<T> extends Base {
foo: Partial<T>; // or other mapped type
}
foo: Partial<T>; // or other mapped type
}
// Repro from #13747
class Form<T> {
private values: {[P in keyof T]?: T[P]} = {}
}
//// [mappedTypesAndObjects.js]
function f1(x, y) {
@ -44,12 +55,23 @@ function f2(x, y) {
obj = x;
obj = y;
}
function f3(x) {
x = {};
}
;
// Repro from #13747
var Form = (function () {
function Form() {
this.values = {};
}
return Form;
}());
//// [mappedTypesAndObjects.d.ts]
declare function f1<T>(x: Partial<T>, y: Readonly<T>): void;
declare function f2<T>(x: Partial<T>, y: Readonly<T>): void;
declare function f3<T>(x: Partial<T>): void;
interface Base {
foo: {
[key: string]: any;
@ -70,3 +92,6 @@ interface E2 extends Base {
interface E3<T> extends Base {
foo: Partial<T>;
}
declare class Form<T> {
private values;
}

View File

@ -45,54 +45,80 @@ function f2<T>(x: Partial<T>, y: Readonly<T>) {
>y : Symbol(y, Decl(mappedTypesAndObjects.ts, 7, 29))
}
function f3<T>(x: Partial<T>) {
>f3 : Symbol(f3, Decl(mappedTypesAndObjects.ts, 11, 1))
>T : Symbol(T, Decl(mappedTypesAndObjects.ts, 13, 12))
>x : Symbol(x, Decl(mappedTypesAndObjects.ts, 13, 15))
>Partial : Symbol(Partial, Decl(lib.d.ts, --, --))
>T : Symbol(T, Decl(mappedTypesAndObjects.ts, 13, 12))
x = {};
>x : Symbol(x, Decl(mappedTypesAndObjects.ts, 13, 15))
}
// Repro from #12900
interface Base {
>Base : Symbol(Base, Decl(mappedTypesAndObjects.ts, 11, 1))
>Base : Symbol(Base, Decl(mappedTypesAndObjects.ts, 15, 1))
foo: { [key: string]: any };
>foo : Symbol(Base.foo, Decl(mappedTypesAndObjects.ts, 15, 16))
>key : Symbol(key, Decl(mappedTypesAndObjects.ts, 16, 11))
foo: { [key: string]: any };
>foo : Symbol(Base.foo, Decl(mappedTypesAndObjects.ts, 19, 16))
>key : Symbol(key, Decl(mappedTypesAndObjects.ts, 20, 12))
bar: any;
>bar : Symbol(Base.bar, Decl(mappedTypesAndObjects.ts, 16, 31))
bar: any;
>bar : Symbol(Base.bar, Decl(mappedTypesAndObjects.ts, 20, 32))
baz: any;
>baz : Symbol(Base.baz, Decl(mappedTypesAndObjects.ts, 17, 12))
baz: any;
>baz : Symbol(Base.baz, Decl(mappedTypesAndObjects.ts, 21, 13))
}
interface E1<T> extends Base {
>E1 : Symbol(E1, Decl(mappedTypesAndObjects.ts, 19, 1))
>T : Symbol(T, Decl(mappedTypesAndObjects.ts, 21, 13))
>Base : Symbol(Base, Decl(mappedTypesAndObjects.ts, 11, 1))
>E1 : Symbol(E1, Decl(mappedTypesAndObjects.ts, 23, 1))
>T : Symbol(T, Decl(mappedTypesAndObjects.ts, 25, 13))
>Base : Symbol(Base, Decl(mappedTypesAndObjects.ts, 15, 1))
foo: T;
>foo : Symbol(E1.foo, Decl(mappedTypesAndObjects.ts, 21, 30))
>T : Symbol(T, Decl(mappedTypesAndObjects.ts, 21, 13))
foo: T;
>foo : Symbol(E1.foo, Decl(mappedTypesAndObjects.ts, 25, 30))
>T : Symbol(T, Decl(mappedTypesAndObjects.ts, 25, 13))
}
interface Something { name: string, value: string };
>Something : Symbol(Something, Decl(mappedTypesAndObjects.ts, 23, 1))
>name : Symbol(Something.name, Decl(mappedTypesAndObjects.ts, 25, 21))
>value : Symbol(Something.value, Decl(mappedTypesAndObjects.ts, 25, 35))
>Something : Symbol(Something, Decl(mappedTypesAndObjects.ts, 27, 1))
>name : Symbol(Something.name, Decl(mappedTypesAndObjects.ts, 29, 21))
>value : Symbol(Something.value, Decl(mappedTypesAndObjects.ts, 29, 35))
interface E2 extends Base {
>E2 : Symbol(E2, Decl(mappedTypesAndObjects.ts, 25, 52))
>Base : Symbol(Base, Decl(mappedTypesAndObjects.ts, 11, 1))
>E2 : Symbol(E2, Decl(mappedTypesAndObjects.ts, 29, 52))
>Base : Symbol(Base, Decl(mappedTypesAndObjects.ts, 15, 1))
foo: Partial<Something>; // or other mapped type
>foo : Symbol(E2.foo, Decl(mappedTypesAndObjects.ts, 26, 27))
foo: Partial<Something>; // or other mapped type
>foo : Symbol(E2.foo, Decl(mappedTypesAndObjects.ts, 30, 27))
>Partial : Symbol(Partial, Decl(lib.d.ts, --, --))
>Something : Symbol(Something, Decl(mappedTypesAndObjects.ts, 23, 1))
>Something : Symbol(Something, Decl(mappedTypesAndObjects.ts, 27, 1))
}
interface E3<T> extends Base {
>E3 : Symbol(E3, Decl(mappedTypesAndObjects.ts, 28, 1))
>T : Symbol(T, Decl(mappedTypesAndObjects.ts, 30, 13))
>Base : Symbol(Base, Decl(mappedTypesAndObjects.ts, 11, 1))
>E3 : Symbol(E3, Decl(mappedTypesAndObjects.ts, 32, 1))
>T : Symbol(T, Decl(mappedTypesAndObjects.ts, 34, 13))
>Base : Symbol(Base, Decl(mappedTypesAndObjects.ts, 15, 1))
foo: Partial<T>; // or other mapped type
>foo : Symbol(E3.foo, Decl(mappedTypesAndObjects.ts, 30, 30))
foo: Partial<T>; // or other mapped type
>foo : Symbol(E3.foo, Decl(mappedTypesAndObjects.ts, 34, 30))
>Partial : Symbol(Partial, Decl(lib.d.ts, --, --))
>T : Symbol(T, Decl(mappedTypesAndObjects.ts, 30, 13))
>T : Symbol(T, Decl(mappedTypesAndObjects.ts, 34, 13))
}
// Repro from #13747
class Form<T> {
>Form : Symbol(Form, Decl(mappedTypesAndObjects.ts, 36, 1))
>T : Symbol(T, Decl(mappedTypesAndObjects.ts, 40, 11))
private values: {[P in keyof T]?: T[P]} = {}
>values : Symbol(Form.values, Decl(mappedTypesAndObjects.ts, 40, 15))
>P : Symbol(P, Decl(mappedTypesAndObjects.ts, 41, 22))
>T : Symbol(T, Decl(mappedTypesAndObjects.ts, 40, 11))
>T : Symbol(T, Decl(mappedTypesAndObjects.ts, 40, 11))
>P : Symbol(P, Decl(mappedTypesAndObjects.ts, 41, 22))
}

View File

@ -49,19 +49,32 @@ function f2<T>(x: Partial<T>, y: Readonly<T>) {
>y : Readonly<T>
}
function f3<T>(x: Partial<T>) {
>f3 : <T>(x: Partial<T>) => void
>T : T
>x : Partial<T>
>Partial : Partial<T>
>T : T
x = {};
>x = {} : {}
>x : Partial<T>
>{} : {}
}
// Repro from #12900
interface Base {
>Base : Base
foo: { [key: string]: any };
foo: { [key: string]: any };
>foo : { [key: string]: any; }
>key : string
bar: any;
bar: any;
>bar : any
baz: any;
baz: any;
>baz : any
}
@ -70,7 +83,7 @@ interface E1<T> extends Base {
>T : T
>Base : Base
foo: T;
foo: T;
>foo : T
>T : T
}
@ -84,7 +97,7 @@ interface E2 extends Base {
>E2 : E2
>Base : Base
foo: Partial<Something>; // or other mapped type
foo: Partial<Something>; // or other mapped type
>foo : Partial<Something>
>Partial : Partial<T>
>Something : Something
@ -95,8 +108,24 @@ interface E3<T> extends Base {
>T : T
>Base : Base
foo: Partial<T>; // or other mapped type
foo: Partial<T>; // or other mapped type
>foo : Partial<T>
>Partial : Partial<T>
>T : T
}
// Repro from #13747
class Form<T> {
>Form : Form<T>
>T : T
private values: {[P in keyof T]?: T[P]} = {}
>values : { [P in keyof T]?: T[P] | undefined; }
>P : P
>T : T
>T : T
>P : P
>{} : {}
}