File: subtypingWithConstructSignatures6.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 (160 lines) | stat: -rw-r--r-- 12,215 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts(24,11): error TS2430: Interface 'I<T>' incorrectly extends interface 'A'.
  Types of property 'a' are incompatible.
    Type 'new (x: T) => T[]' is not assignable to type 'new <T>(x: T) => T[]'.
      Types of parameters 'x' and 'x' are incompatible.
        Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
          'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts(28,11): error TS2430: Interface 'I2<T>' incorrectly extends interface 'A'.
  Types of property 'a2' are incompatible.
    Type 'new (x: T) => string[]' is not assignable to type 'new <T>(x: T) => string[]'.
      Types of parameters 'x' and 'x' are incompatible.
        Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
          'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts(32,11): error TS2430: Interface 'I3<T>' incorrectly extends interface 'A'.
  Types of property 'a3' are incompatible.
    Type 'new (x: T) => T' is not assignable to type 'new <T>(x: T) => void'.
      Types of parameters 'x' and 'x' are incompatible.
        Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
          'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts(36,11): error TS2430: Interface 'I4<T>' incorrectly extends interface 'A'.
  Types of property 'a4' are incompatible.
    Type 'new <U>(x: T, y: U) => string' is not assignable to type 'new <T, U>(x: T, y: U) => string'.
      Types of parameters 'x' and 'x' are incompatible.
        Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
          'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts(40,11): error TS2430: Interface 'I5<T>' incorrectly extends interface 'A'.
  Types of property 'a5' are incompatible.
    Type 'new <U>(x: (arg: T) => U) => T' is not assignable to type 'new <T, U>(x: (arg: T) => U) => T'.
      Types of parameters 'x' and 'x' are incompatible.
        Types of parameters 'arg' and 'arg' are incompatible.
          Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
            'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts(44,11): error TS2430: Interface 'I7<T>' incorrectly extends interface 'A'.
  Types of property 'a11' are incompatible.
    Type 'new <U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base' is not assignable to type 'new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base'.
      Types of parameters 'x' and 'x' are incompatible.
        Type '{ foo: T; }' is not assignable to type '{ foo: T; }'. Two different types with this name exist, but they are unrelated.
          Types of property 'foo' are incompatible.
            Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
              'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts(48,11): error TS2430: Interface 'I9<T>' incorrectly extends interface 'A'.
  Types of property 'a16' are incompatible.
    Type 'new (x: { a: T; b: T; }) => T[]' is not assignable to type 'new <T extends Base>(x: { a: T; b: T; }) => T[]'.
      Types of parameters 'x' and 'x' are incompatible.
        Type '{ a: T; b: T; }' is not assignable to type '{ a: T; b: T; }'. Two different types with this name exist, but they are unrelated.
          Types of property 'a' are incompatible.
            Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
              'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.


==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts (7 errors) ====
    // checking subtype relations for function types as it relates to contextual signature instantiation
    // same as subtypingWithConstructSignatures4 but using class type parameters instead of generic signatures
    // all are errors
    
    class Base { foo: string; }
    class Derived extends Base { bar: string; }
    class Derived2 extends Derived { baz: string; }
    class OtherDerived extends Base { bing: string; }
    
    interface A { // T
        // M's
        a: new <T>(x: T) => T[];
        a2: new <T>(x: T) => string[];
        a3: new <T>(x: T) => void;
        a4: new <T, U>(x: T, y: U) => string;
        a5: new <T, U>(x: (arg: T) => U) => T;
        a6: new <T extends Base>(x: (arg: T) => Derived) => T;
        a11: new <T>(x: { foo: T }, y: { foo: T; bar: T }) => Base;
        a15: new <T>(x: { a: T; b: T }) => T[];
        a16: new <T extends Base>(x: { a: T; b: T }) => T[];
    }
    
    // S's
    interface I<T> extends A {
              ~
!!! error TS2430: Interface 'I<T>' incorrectly extends interface 'A'.
!!! error TS2430:   Types of property 'a' are incompatible.
!!! error TS2430:     Type 'new (x: T) => T[]' is not assignable to type 'new <T>(x: T) => T[]'.
!!! error TS2430:       Types of parameters 'x' and 'x' are incompatible.
!!! error TS2430:         Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2430:           'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts:12:13: This type parameter might need an `extends T` constraint.
        a: new (x: T) => T[]; 
    }
    
    interface I2<T> extends A {
              ~~
!!! error TS2430: Interface 'I2<T>' incorrectly extends interface 'A'.
!!! error TS2430:   Types of property 'a2' are incompatible.
!!! error TS2430:     Type 'new (x: T) => string[]' is not assignable to type 'new <T>(x: T) => string[]'.
!!! error TS2430:       Types of parameters 'x' and 'x' are incompatible.
!!! error TS2430:         Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2430:           'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts:13:14: This type parameter might need an `extends T` constraint.
        a2: new (x: T) => string[]; 
    }
    
    interface I3<T> extends A {
              ~~
!!! error TS2430: Interface 'I3<T>' incorrectly extends interface 'A'.
!!! error TS2430:   Types of property 'a3' are incompatible.
!!! error TS2430:     Type 'new (x: T) => T' is not assignable to type 'new <T>(x: T) => void'.
!!! error TS2430:       Types of parameters 'x' and 'x' are incompatible.
!!! error TS2430:         Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2430:           'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts:14:14: This type parameter might need an `extends T` constraint.
        a3: new (x: T) => T;
    }
    
    interface I4<T> extends A {
              ~~
!!! error TS2430: Interface 'I4<T>' incorrectly extends interface 'A'.
!!! error TS2430:   Types of property 'a4' are incompatible.
!!! error TS2430:     Type 'new <U>(x: T, y: U) => string' is not assignable to type 'new <T, U>(x: T, y: U) => string'.
!!! error TS2430:       Types of parameters 'x' and 'x' are incompatible.
!!! error TS2430:         Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2430:           'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts:15:14: This type parameter might need an `extends T` constraint.
        a4: new <U>(x: T, y: U) => string; 
    }
    
    interface I5<T> extends A {
              ~~
!!! error TS2430: Interface 'I5<T>' incorrectly extends interface 'A'.
!!! error TS2430:   Types of property 'a5' are incompatible.
!!! error TS2430:     Type 'new <U>(x: (arg: T) => U) => T' is not assignable to type 'new <T, U>(x: (arg: T) => U) => T'.
!!! error TS2430:       Types of parameters 'x' and 'x' are incompatible.
!!! error TS2430:         Types of parameters 'arg' and 'arg' are incompatible.
!!! error TS2430:           Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2430:             'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts:40:14: This type parameter might need an `extends T` constraint.
        a5: new <U>(x: (arg: T) => U) => T; 
    }
    
    interface I7<T> extends A {
              ~~
!!! error TS2430: Interface 'I7<T>' incorrectly extends interface 'A'.
!!! error TS2430:   Types of property 'a11' are incompatible.
!!! error TS2430:     Type 'new <U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base' is not assignable to type 'new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base'.
!!! error TS2430:       Types of parameters 'x' and 'x' are incompatible.
!!! error TS2430:         Type '{ foo: T; }' is not assignable to type '{ foo: T; }'. Two different types with this name exist, but they are unrelated.
!!! error TS2430:           Types of property 'foo' are incompatible.
!!! error TS2430:             Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2430:               'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts:18:15: This type parameter might need an `extends T` constraint.
        a11: new <U>(x: { foo: T }, y: { foo: U; bar: U }) => Base; 
    }
    
    interface I9<T> extends A {
              ~~
!!! error TS2430: Interface 'I9<T>' incorrectly extends interface 'A'.
!!! error TS2430:   Types of property 'a16' are incompatible.
!!! error TS2430:     Type 'new (x: { a: T; b: T; }) => T[]' is not assignable to type 'new <T extends Base>(x: { a: T; b: T; }) => T[]'.
!!! error TS2430:       Types of parameters 'x' and 'x' are incompatible.
!!! error TS2430:         Type '{ a: T; b: T; }' is not assignable to type '{ a: T; b: T; }'. Two different types with this name exist, but they are unrelated.
!!! error TS2430:           Types of property 'a' are incompatible.
!!! error TS2430:             Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2430:               'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
        a16: new (x: { a: T; b: T }) => T[]; 
    }