Accept new baselines

This commit is contained in:
Anders Hejlsberg 2018-09-17 09:15:52 -07:00
parent 46de5067b0
commit 92c17cebcb
4 changed files with 18 additions and 11 deletions

View file

@ -45,7 +45,7 @@ function boxify<T>(obj: T): Boxified<T> {
}
return <any>obj;
><any>obj : any
>obj : never
>obj : T
}
type A = { a: string };

View file

@ -1,9 +1,12 @@
tests/cases/compiler/recursiveTypeRelations.ts(8,5): error TS2391: Function implementation is missing or not immediately following the declaration.
tests/cases/compiler/recursiveTypeRelations.ts(27,38): error TS2304: Cannot find name 'ClassNameObject'.
tests/cases/compiler/recursiveTypeRelations.ts(27,55): error TS2345: Argument of type '(obj: any, key: keyof S) => any' is not assignable to parameter of type '(previousValue: any, currentValue: string, currentIndex: number, array: string[]) => any'.
Types of parameters 'key' and 'currentValue' are incompatible.
Type 'string' is not assignable to type 'keyof S'.
tests/cases/compiler/recursiveTypeRelations.ts(27,61): error TS2304: Cannot find name 'ClassNameObject'.
==== tests/cases/compiler/recursiveTypeRelations.ts (3 errors) ====
==== tests/cases/compiler/recursiveTypeRelations.ts (4 errors) ====
// Repro from #14896
type Attributes<Keys extends keyof any> = {
@ -35,6 +38,10 @@ tests/cases/compiler/recursiveTypeRelations.ts(27,61): error TS2304: Cannot find
return Object.keys(arg).reduce<ClassNameObject>((obj: ClassNameObject, key: keyof S) => {
~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'ClassNameObject'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(obj: any, key: keyof S) => any' is not assignable to parameter of type '(previousValue: any, currentValue: string, currentIndex: number, array: string[]) => any'.
!!! error TS2345: Types of parameters 'key' and 'currentValue' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type 'keyof S'.
~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'ClassNameObject'.
const exportedClassName = styles[key];

View file

@ -12,7 +12,7 @@ function stringify1(anything: { toString(): string } | undefined): string {
>"string" : "string"
>anything.toUpperCase() : string
>anything.toUpperCase : () => string
>anything : { toString(): string; } & string
>anything : string
>toUpperCase : () => string
>"" : ""
}
@ -29,7 +29,7 @@ function stringify2(anything: {} | undefined): string {
>"string" : "string"
>anything.toUpperCase() : string
>anything.toUpperCase : () => string
>anything : string & {}
>anything : string
>toUpperCase : () => string
>"" : ""
}
@ -64,7 +64,7 @@ function stringify4(anything: { toString?(): string } | undefined): string {
>"string" : "string"
>anything.toUpperCase() : string
>anything.toUpperCase : () => string
>anything : {} & string
>anything : string
>toUpperCase : () => string
>"" : ""
}

View file

@ -14,7 +14,7 @@ if (typeof a === "number") {
let c: number = a;
>c : number
>a : number & {}
>a : number
}
if (typeof a === "string") {
>typeof a === "string" : boolean
@ -24,7 +24,7 @@ if (typeof a === "string") {
let c: string = a;
>c : string
>a : string & {}
>a : string
}
if (typeof a === "boolean") {
>typeof a === "boolean" : boolean
@ -34,7 +34,7 @@ if (typeof a === "boolean") {
let c: boolean = a;
>c : boolean
>a : (false & {}) | (true & {})
>a : boolean
}
if (typeof b === "number") {
@ -45,7 +45,7 @@ if (typeof b === "number") {
let c: number = b;
>c : number
>b : { toString(): string; } & number
>b : number
}
if (typeof b === "string") {
>typeof b === "string" : boolean
@ -55,7 +55,7 @@ if (typeof b === "string") {
let c: string = b;
>c : string
>b : { toString(): string; } & string
>b : string
}
if (typeof b === "boolean") {
>typeof b === "boolean" : boolean
@ -65,6 +65,6 @@ if (typeof b === "boolean") {
let c: boolean = b;
>c : boolean
>b : ({ toString(): string; } & false) | ({ toString(): string; } & true)
>b : boolean
}