|
| 1 | +=== tests/cases/conformance/expressions/functionCalls/callWithSpread.ts === |
| 2 | +interface X { |
| 3 | +>X : Symbol(X, Decl(callWithSpread.ts, 0, 0)) |
| 4 | + |
| 5 | + foo(x: number, y: number, ...z: string[]); |
| 6 | +>foo : Symbol(foo, Decl(callWithSpread.ts, 0, 13)) |
| 7 | +>x : Symbol(x, Decl(callWithSpread.ts, 1, 8)) |
| 8 | +>y : Symbol(y, Decl(callWithSpread.ts, 1, 18)) |
| 9 | +>z : Symbol(z, Decl(callWithSpread.ts, 1, 29)) |
| 10 | +} |
| 11 | + |
| 12 | +function foo(x: number, y: number, ...z: string[]) { |
| 13 | +>foo : Symbol(foo, Decl(callWithSpread.ts, 2, 1)) |
| 14 | +>x : Symbol(x, Decl(callWithSpread.ts, 4, 13)) |
| 15 | +>y : Symbol(y, Decl(callWithSpread.ts, 4, 23)) |
| 16 | +>z : Symbol(z, Decl(callWithSpread.ts, 4, 34)) |
| 17 | +} |
| 18 | + |
| 19 | +var a: string[]; |
| 20 | +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) |
| 21 | + |
| 22 | +var z: number[]; |
| 23 | +>z : Symbol(z, Decl(callWithSpread.ts, 8, 3)) |
| 24 | + |
| 25 | +var obj: X; |
| 26 | +>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3)) |
| 27 | +>X : Symbol(X, Decl(callWithSpread.ts, 0, 0)) |
| 28 | + |
| 29 | +var xa: X[]; |
| 30 | +>xa : Symbol(xa, Decl(callWithSpread.ts, 10, 3)) |
| 31 | +>X : Symbol(X, Decl(callWithSpread.ts, 0, 0)) |
| 32 | + |
| 33 | +foo(1, 2, "abc"); |
| 34 | +>foo : Symbol(foo, Decl(callWithSpread.ts, 2, 1)) |
| 35 | + |
| 36 | +foo(1, 2, ...a); |
| 37 | +>foo : Symbol(foo, Decl(callWithSpread.ts, 2, 1)) |
| 38 | +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) |
| 39 | + |
| 40 | +foo(1, 2, ...a, "abc"); |
| 41 | +>foo : Symbol(foo, Decl(callWithSpread.ts, 2, 1)) |
| 42 | +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) |
| 43 | + |
| 44 | +obj.foo(1, 2, "abc"); |
| 45 | +>obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 46 | +>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3)) |
| 47 | +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 48 | + |
| 49 | +obj.foo(1, 2, ...a); |
| 50 | +>obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 51 | +>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3)) |
| 52 | +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 53 | +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) |
| 54 | + |
| 55 | +obj.foo(1, 2, ...a, "abc"); |
| 56 | +>obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 57 | +>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3)) |
| 58 | +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 59 | +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) |
| 60 | + |
| 61 | +(obj.foo)(1, 2, "abc"); |
| 62 | +>obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 63 | +>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3)) |
| 64 | +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 65 | + |
| 66 | +(obj.foo)(1, 2, ...a); |
| 67 | +>obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 68 | +>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3)) |
| 69 | +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 70 | +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) |
| 71 | + |
| 72 | +(obj.foo)(1, 2, ...a, "abc"); |
| 73 | +>obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 74 | +>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3)) |
| 75 | +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 76 | +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) |
| 77 | + |
| 78 | +xa[1].foo(1, 2, "abc"); |
| 79 | +>xa[1].foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 80 | +>xa : Symbol(xa, Decl(callWithSpread.ts, 10, 3)) |
| 81 | +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 82 | + |
| 83 | +xa[1].foo(1, 2, ...a); |
| 84 | +>xa[1].foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 85 | +>xa : Symbol(xa, Decl(callWithSpread.ts, 10, 3)) |
| 86 | +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 87 | +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) |
| 88 | + |
| 89 | +xa[1].foo(1, 2, ...a, "abc"); |
| 90 | +>xa[1].foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 91 | +>xa : Symbol(xa, Decl(callWithSpread.ts, 10, 3)) |
| 92 | +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 93 | +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) |
| 94 | + |
| 95 | +(<Function>xa[1].foo)(...[1, 2, "abc"]); |
| 96 | +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) |
| 97 | +>xa[1].foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 98 | +>xa : Symbol(xa, Decl(callWithSpread.ts, 10, 3)) |
| 99 | +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) |
| 100 | + |
| 101 | +class C { |
| 102 | +>C : Symbol(C, Decl(callWithSpread.ts, 28, 40)) |
| 103 | + |
| 104 | + constructor(x: number, y: number, ...z: string[]) { |
| 105 | +>x : Symbol(x, Decl(callWithSpread.ts, 31, 16)) |
| 106 | +>y : Symbol(y, Decl(callWithSpread.ts, 31, 26)) |
| 107 | +>z : Symbol(z, Decl(callWithSpread.ts, 31, 37)) |
| 108 | + |
| 109 | + this.foo(x, y); |
| 110 | +>this.foo : Symbol(foo, Decl(callWithSpread.ts, 34, 5)) |
| 111 | +>this : Symbol(C, Decl(callWithSpread.ts, 28, 40)) |
| 112 | +>foo : Symbol(foo, Decl(callWithSpread.ts, 34, 5)) |
| 113 | +>x : Symbol(x, Decl(callWithSpread.ts, 31, 16)) |
| 114 | +>y : Symbol(y, Decl(callWithSpread.ts, 31, 26)) |
| 115 | + |
| 116 | + this.foo(x, y, ...z); |
| 117 | +>this.foo : Symbol(foo, Decl(callWithSpread.ts, 34, 5)) |
| 118 | +>this : Symbol(C, Decl(callWithSpread.ts, 28, 40)) |
| 119 | +>foo : Symbol(foo, Decl(callWithSpread.ts, 34, 5)) |
| 120 | +>x : Symbol(x, Decl(callWithSpread.ts, 31, 16)) |
| 121 | +>y : Symbol(y, Decl(callWithSpread.ts, 31, 26)) |
| 122 | +>z : Symbol(z, Decl(callWithSpread.ts, 31, 37)) |
| 123 | + } |
| 124 | + foo(x: number, y: number, ...z: string[]) { |
| 125 | +>foo : Symbol(foo, Decl(callWithSpread.ts, 34, 5)) |
| 126 | +>x : Symbol(x, Decl(callWithSpread.ts, 35, 8)) |
| 127 | +>y : Symbol(y, Decl(callWithSpread.ts, 35, 18)) |
| 128 | +>z : Symbol(z, Decl(callWithSpread.ts, 35, 29)) |
| 129 | + } |
| 130 | +} |
| 131 | + |
| 132 | +class D extends C { |
| 133 | +>D : Symbol(D, Decl(callWithSpread.ts, 37, 1)) |
| 134 | +>C : Symbol(C, Decl(callWithSpread.ts, 28, 40)) |
| 135 | + |
| 136 | + constructor() { |
| 137 | + super(1, 2); |
| 138 | +>super : Symbol(C, Decl(callWithSpread.ts, 28, 40)) |
| 139 | + |
| 140 | + super(1, 2, ...a); |
| 141 | +>super : Symbol(C, Decl(callWithSpread.ts, 28, 40)) |
| 142 | +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) |
| 143 | + } |
| 144 | + foo() { |
| 145 | +>foo : Symbol(foo, Decl(callWithSpread.ts, 43, 5)) |
| 146 | + |
| 147 | + super.foo(1, 2); |
| 148 | +>super.foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5)) |
| 149 | +>super : Symbol(C, Decl(callWithSpread.ts, 28, 40)) |
| 150 | +>foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5)) |
| 151 | + |
| 152 | + super.foo(1, 2, ...a); |
| 153 | +>super.foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5)) |
| 154 | +>super : Symbol(C, Decl(callWithSpread.ts, 28, 40)) |
| 155 | +>foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5)) |
| 156 | +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) |
| 157 | + } |
| 158 | +} |
| 159 | + |
0 commit comments