File: classExpressionAssignment.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (16 lines) | stat: -rw-r--r-- 664 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
tests/cases/compiler/classExpressionAssignment.ts(6,7): error TS2322: Type 'typeof A' is not assignable to type 'new () => A'.
  Property 'prop' is missing in type 'A' but required in type 'A'.


==== tests/cases/compiler/classExpressionAssignment.ts (1 errors) ====
    interface A {
      prop: string;
    }
    
    // This is invalid
    const A: {new(): A} = class {}
          ~
!!! error TS2322: Type 'typeof A' is not assignable to type 'new () => A'.
!!! error TS2322:   Property 'prop' is missing in type 'A' but required in type 'A'.
!!! related TS2728 tests/cases/compiler/classExpressionAssignment.ts:2:3: 'prop' is declared here.