File: typeArgumentInferenceWithClassExpression2.errors.txt

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (15 lines) | stat: -rw-r--r-- 1,059 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
tests/cases/conformance/es6/classExpressions/typeArgumentInferenceWithClassExpression2.ts(6,5): error TS2345: Argument of type 'typeof (Anonymous class)' is not assignable to parameter of type 'typeof (Anonymous class)'.
  Property 'prop' is missing in type '(Anonymous class)' but required in type 'foo<{}>.(Anonymous class)'.


==== tests/cases/conformance/es6/classExpressions/typeArgumentInferenceWithClassExpression2.ts (1 errors) ====
    function foo<T>(x = class { prop: T }): T {
        return undefined;
    }
    
    // Should not infer string because it is a static property
    foo(class { static prop = "hello" }).length;
        ~~~~~
!!! error TS2345: Argument of type 'typeof (Anonymous class)' is not assignable to parameter of type 'typeof (Anonymous class)'.
!!! error TS2345:   Property 'prop' is missing in type '(Anonymous class)' but required in type 'foo<{}>.(Anonymous class)'.
!!! related TS2728 tests/cases/conformance/es6/classExpressions/typeArgumentInferenceWithClassExpression2.ts:1:29: 'prop' is declared here.