diff --git a/tests/baselines/reference/mappedTypes4.types b/tests/baselines/reference/mappedTypes4.types index 039aabb7306..fac8d982e92 100644 --- a/tests/baselines/reference/mappedTypes4.types +++ b/tests/baselines/reference/mappedTypes4.types @@ -45,7 +45,7 @@ function boxify(obj: T): Boxified { } return obj; >obj : any ->obj : never +>obj : T } type A = { a: string }; diff --git a/tests/baselines/reference/recursiveTypeRelations.errors.txt b/tests/baselines/reference/recursiveTypeRelations.errors.txt index 8c5596958c3..e39ca75dab9 100644 --- a/tests/baselines/reference/recursiveTypeRelations.errors.txt +++ b/tests/baselines/reference/recursiveTypeRelations.errors.txt @@ -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 = { @@ -35,6 +38,10 @@ tests/cases/compiler/recursiveTypeRelations.ts(27,61): error TS2304: Cannot find return Object.keys(arg).reduce((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]; diff --git a/tests/baselines/reference/strictTypeofUnionNarrowing.types b/tests/baselines/reference/strictTypeofUnionNarrowing.types index 3039ece15d6..1ec44e14ff0 100644 --- a/tests/baselines/reference/strictTypeofUnionNarrowing.types +++ b/tests/baselines/reference/strictTypeofUnionNarrowing.types @@ -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 >"" : "" } diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfPrimitiveSubtype.types b/tests/baselines/reference/typeGuardOfFormTypeOfPrimitiveSubtype.types index 6510b73d44d..4787c07d758 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfPrimitiveSubtype.types +++ b/tests/baselines/reference/typeGuardOfFormTypeOfPrimitiveSubtype.types @@ -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 }