File: typeParameterWithInvalidConstraintType.errors.txt

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (28 lines) | stat: -rw-r--r-- 1,321 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
tests/cases/compiler/typeParameterWithInvalidConstraintType.ts(1,19): error TS2313: Type parameter 'T' has a circular constraint.
tests/cases/compiler/typeParameterWithInvalidConstraintType.ts(4,19): error TS2339: Property 'foo' does not exist on type 'T'.
tests/cases/compiler/typeParameterWithInvalidConstraintType.ts(5,21): error TS2351: This expression is not constructable.
  Type '{}' has no construct signatures.
tests/cases/compiler/typeParameterWithInvalidConstraintType.ts(7,17): error TS2349: This expression is not callable.
  Type '{}' has no call signatures.


==== tests/cases/compiler/typeParameterWithInvalidConstraintType.ts (4 errors) ====
    class A<T extends T> {
                      ~
!!! error TS2313: Type parameter 'T' has a circular constraint.
        foo() {
            var x: T;
            var a = x.foo();
                      ~~~
!!! error TS2339: Property 'foo' does not exist on type 'T'.
            var b = new x(123);
                        ~
!!! error TS2351: This expression is not constructable.
!!! error TS2351:   Type '{}' has no construct signatures.
            var c = x[1];
            var d = x();
                    ~
!!! error TS2349: This expression is not callable.
!!! error TS2349:   Type '{}' has no call signatures.
        }
    }