File: typeParameterUsedAsTypeParameterConstraint4.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (86 lines) | stat: -rw-r--r-- 4,061 bytes parent folder | download | duplicates (7)
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
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(5,8): error TS2304: Cannot find name 'W'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(15,8): error TS2304: Cannot find name 'W'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(19,43): error TS2304: Cannot find name 'V'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(20,47): error TS2304: Cannot find name 'X'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(28,44): error TS2304: Cannot find name 'W'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(29,47): error TS2304: Cannot find name 'Y'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(38,47): error TS2304: Cannot find name 'X'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(38,53): error TS2304: Cannot find name 'Y'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(46,30): error TS2304: Cannot find name 'V'.
tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(46,36): error TS2304: Cannot find name 'X'.


==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts (10 errors) ====
    // Type parameters are in scope in their own and other type parameter lists
    // Some negative cases
    
    class C<T, U extends T, V extends U> {
        z: W; // error
           ~
!!! error TS2304: Cannot find name 'W'.
        foo<W extends V>(x: W): T {
            var r: T;
            return x;
        }
    }
    
    interface I<T, U extends T, V extends U> {
        x: T;
        y: U;
        z: W; // error
           ~
!!! error TS2304: Cannot find name 'W'.
        foo<W extends V>(x: W): T;
    }
    
    function foo<T, U extends T>(x: T, y: U): V { // error
                                              ~
!!! error TS2304: Cannot find name 'V'.
        function bar<V extends T, W extends U>(): X { // error
                                                  ~
!!! error TS2304: Cannot find name 'X'.
            function baz<X extends W, Y extends V>(a: X, b: Y): T {
                x = y;
                return y;
            }
        }
    }
    
    function foo2<U extends T, T>(x: T, y: U): W { // error
                                               ~
!!! error TS2304: Cannot find name 'W'.
        function bar<V extends T, W extends U>(): Y { // error
                                                  ~
!!! error TS2304: Cannot find name 'Y'.
            function baz<X extends W, Y extends V>(a: X, b: Y): T {
                x = y;
                return y;
            }
        }
    }
    
    var f3 = <T, U extends T>(x: T, y: U) => {
        function bar<V extends T, W extends U>(r: X, s: Y) { // error
                                                  ~
!!! error TS2304: Cannot find name 'X'.
                                                        ~
!!! error TS2304: Cannot find name 'Y'.
            var g = <X extends W, Y extends V>(a: X, b: Y): T => {
                x = y;
                return y;
            }
        }
    }
    
    var f4 = <U extends T, T>(x: V, y: X) => { // error
                                 ~
!!! error TS2304: Cannot find name 'V'.
                                       ~
!!! error TS2304: Cannot find name 'X'.
        function bar<V extends T, W extends U>() {
            var g = <X extends W, Y extends V>(a: X, b: Y): T => {
                x = y;
                return y;
            }
        }
    }