Skip to content

Commit

Permalink
Update baseline due to reverting lib
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuckton committed Jul 13, 2020
1 parent 42528ab commit 65a49a7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/compiler/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ namespace ts {

Object.defineProperties(objectAllocator.getSignatureConstructor().prototype, {
__debugFlags: { get(this: Signature) { return formatSignatureFlags(this.flags); } },
__debugSignatureToString: { value(this: Signature) { return this.checker?.signatureToString(this) } }
__debugSignatureToString: { value(this: Signature) { return this.checker?.signatureToString(this); } }
});

const nodeConstructors = [
Expand Down
20 changes: 15 additions & 5 deletions tests/baselines/reference/inferTypes1.errors.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
tests/cases/conformance/types/conditional/inferTypes1.ts(36,23): error TS2344: Type 'string' does not satisfy the constraint '(...args: any) => any'.
tests/cases/conformance/types/conditional/inferTypes1.ts(37,23): error TS2344: Type 'Function' does not satisfy the constraint '(...args: any) => any'.
Type 'Function' provides no match for the signature '(...args: any): any'.
tests/cases/conformance/types/conditional/inferTypes1.ts(43,25): error TS2344: Type 'string' does not satisfy the constraint 'abstract new (...args: any) => any'.
tests/cases/conformance/types/conditional/inferTypes1.ts(44,25): error TS2344: Type 'Function' does not satisfy the constraint 'abstract new (...args: any) => any'.
tests/cases/conformance/types/conditional/inferTypes1.ts(43,25): error TS2344: Type 'string' does not satisfy the constraint 'new (...args: any) => any'.
tests/cases/conformance/types/conditional/inferTypes1.ts(44,25): error TS2344: Type 'Function' does not satisfy the constraint 'new (...args: any) => any'.
Type 'Function' provides no match for the signature 'new (...args: any): any'.
tests/cases/conformance/types/conditional/inferTypes1.ts(45,25): error TS2344: Type 'typeof Abstract' does not satisfy the constraint 'new (...args: any) => any'.
Cannot assign an abstract constructor type to a non-abstract constructor type.
tests/cases/conformance/types/conditional/inferTypes1.ts(47,42): error TS2344: Type 'abstract new (x: string, ...args: T) => T[]' does not satisfy the constraint 'new (...args: any) => any'.
Cannot assign an abstract constructor type to a non-abstract constructor type.
tests/cases/conformance/types/conditional/inferTypes1.ts(55,25): error TS2344: Type '(x: string, y: string) => number' does not satisfy the constraint '(x: any) => any'.
tests/cases/conformance/types/conditional/inferTypes1.ts(56,25): error TS2344: Type 'Function' does not satisfy the constraint '(x: any) => any'.
Type 'Function' provides no match for the signature '(x: any): any'.
Expand All @@ -21,7 +25,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(153,40): error TS2322:
Type 'T' is not assignable to type 'symbol'.


==== tests/cases/conformance/types/conditional/inferTypes1.ts (16 errors) ====
==== tests/cases/conformance/types/conditional/inferTypes1.ts (18 errors) ====
type Unpacked<T> =
T extends (infer U)[] ? U :
T extends (...args: any[]) => infer U ? U :
Expand Down Expand Up @@ -71,14 +75,20 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(153,40): error TS2322:
type U12 = InstanceType<never>; // never
type U13 = InstanceType<string>; // Error
~~~~~~
!!! error TS2344: Type 'string' does not satisfy the constraint 'abstract new (...args: any) => any'.
!!! error TS2344: Type 'string' does not satisfy the constraint 'new (...args: any) => any'.
type U14 = InstanceType<Function>; // Error
~~~~~~~~
!!! error TS2344: Type 'Function' does not satisfy the constraint 'abstract new (...args: any) => any'.
!!! error TS2344: Type 'Function' does not satisfy the constraint 'new (...args: any) => any'.
!!! error TS2344: Type 'Function' provides no match for the signature 'new (...args: any): any'.
type U15 = InstanceType<typeof Abstract>; // Abstract
~~~~~~~~~~~~~~~
!!! error TS2344: Type 'typeof Abstract' does not satisfy the constraint 'new (...args: any) => any'.
!!! error TS2344: Cannot assign an abstract constructor type to a non-abstract constructor type.
type U16<T extends any[]> = InstanceType<new (x: string, ...args: T) => T[]>; // T[]
type U17<T extends any[]> = InstanceType<abstract new (x: string, ...args: T) => T[]>; // T[]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2344: Type 'abstract new (x: string, ...args: T) => T[]' does not satisfy the constraint 'new (...args: any) => any'.
!!! error TS2344: Cannot assign an abstract constructor type to a non-abstract constructor type.

type ArgumentType<T extends (x: any) => any> = T extends (a: infer A) => any ? A : any;

Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/inferTypes1.types
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ type U14 = InstanceType<Function>; // Error
>U14 : any

type U15 = InstanceType<typeof Abstract>; // Abstract
>U15 : Abstract
>U15 : any
>Abstract : typeof Abstract

type U16<T extends any[]> = InstanceType<new (x: string, ...args: T) => T[]>; // T[]
Expand All @@ -126,7 +126,7 @@ type U16<T extends any[]> = InstanceType<new (x: string, ...args: T) => T[]>; /
>args : T

type U17<T extends any[]> = InstanceType<abstract new (x: string, ...args: T) => T[]>; // T[]
>U17 : T[]
>U17 : any
>x : string
>args : T

Expand Down

0 comments on commit 65a49a7

Please sign in to comment.