File: typeParametersShouldNotBeEqual2.errors.txt

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (41 lines) | stat: -rw-r--r-- 2,079 bytes parent folder | download | duplicates (3)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'.
  Type 'Date' is not assignable to type 'T'.
tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(5,5): error TS2322: Type 'V' is not assignable to type 'T'.
tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(6,5): error TS2322: Type 'T' is not assignable to type 'V'.
  Type 'Date' is not assignable to type 'V'.
tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(7,5): error TS2322: Type 'V' is not assignable to type 'U'.
tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(8,5): error TS2322: Type 'U' is not assignable to type 'V'.
  Type 'Date' is not assignable to type 'V'.
tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(9,5): error TS2322: Type 'Object' is not assignable to type 'T'.
  The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?


==== tests/cases/compiler/typeParametersShouldNotBeEqual2.ts (6 errors) ====
    function ff<T extends Date, U extends Date, V>(x: T, y: U, z: V) {
        var zz: Object;
        x = x;  // Ok
        x = y;  // Ok
        ~
!!! error TS2322: Type 'U' is not assignable to type 'T'.
!!! error TS2322:   Type 'Date' is not assignable to type 'T'.
        x = z;  // Error
        ~
!!! error TS2322: Type 'V' is not assignable to type 'T'.
        z = x;  // Error
        ~
!!! error TS2322: Type 'T' is not assignable to type 'V'.
!!! error TS2322:   Type 'Date' is not assignable to type 'V'.
        y = z;  // Error
        ~
!!! error TS2322: Type 'V' is not assignable to type 'U'.
        z = y;  // Error
        ~
!!! error TS2322: Type 'U' is not assignable to type 'V'.
!!! error TS2322:   Type 'Date' is not assignable to type 'V'.
        x = zz;  // Error
        ~
!!! error TS2322: Type 'Object' is not assignable to type 'T'.
!!! error TS2322:   The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
        zz = x;  // Ok
    }