|
| 1 | +=== tests/cases/compiler/intersectionOfCallsWithSameParameters.ts === |
| 2 | +interface One { |
| 3 | +>One : Symbol(One, Decl(intersectionOfCallsWithSameParameters.ts, 0, 0)) |
| 4 | + |
| 5 | + overload(id: string): { one: number }; |
| 6 | +>overload : Symbol(One.overload, Decl(intersectionOfCallsWithSameParameters.ts, 0, 15)) |
| 7 | +>id : Symbol(id, Decl(intersectionOfCallsWithSameParameters.ts, 1, 13)) |
| 8 | +>one : Symbol(one, Decl(intersectionOfCallsWithSameParameters.ts, 1, 27)) |
| 9 | + |
| 10 | + intersect(id: string): { one: number }; |
| 11 | +>intersect : Symbol(One.intersect, Decl(intersectionOfCallsWithSameParameters.ts, 1, 42)) |
| 12 | +>id : Symbol(id, Decl(intersectionOfCallsWithSameParameters.ts, 2, 14)) |
| 13 | +>one : Symbol(one, Decl(intersectionOfCallsWithSameParameters.ts, 2, 28)) |
| 14 | +} |
| 15 | + |
| 16 | +interface Two { |
| 17 | +>Two : Symbol(Two, Decl(intersectionOfCallsWithSameParameters.ts, 3, 1)) |
| 18 | + |
| 19 | + overload(id: number): { two: number }; |
| 20 | +>overload : Symbol(Two.overload, Decl(intersectionOfCallsWithSameParameters.ts, 5, 15)) |
| 21 | +>id : Symbol(id, Decl(intersectionOfCallsWithSameParameters.ts, 6, 13)) |
| 22 | +>two : Symbol(two, Decl(intersectionOfCallsWithSameParameters.ts, 6, 27)) |
| 23 | + |
| 24 | + intersect(id: string): { two: number }; |
| 25 | +>intersect : Symbol(Two.intersect, Decl(intersectionOfCallsWithSameParameters.ts, 6, 42)) |
| 26 | +>id : Symbol(id, Decl(intersectionOfCallsWithSameParameters.ts, 7, 14)) |
| 27 | +>two : Symbol(two, Decl(intersectionOfCallsWithSameParameters.ts, 7, 28)) |
| 28 | +} |
| 29 | + |
| 30 | +class Both implements One, Two { |
| 31 | +>Both : Symbol(Both, Decl(intersectionOfCallsWithSameParameters.ts, 8, 1)) |
| 32 | +>One : Symbol(One, Decl(intersectionOfCallsWithSameParameters.ts, 0, 0)) |
| 33 | +>Two : Symbol(Two, Decl(intersectionOfCallsWithSameParameters.ts, 3, 1)) |
| 34 | + |
| 35 | + overload(id: number): { two: number }; |
| 36 | +>overload : Symbol(Both.overload, Decl(intersectionOfCallsWithSameParameters.ts, 10, 32), Decl(intersectionOfCallsWithSameParameters.ts, 11, 42), Decl(intersectionOfCallsWithSameParameters.ts, 12, 42)) |
| 37 | +>id : Symbol(id, Decl(intersectionOfCallsWithSameParameters.ts, 11, 13)) |
| 38 | +>two : Symbol(two, Decl(intersectionOfCallsWithSameParameters.ts, 11, 27)) |
| 39 | + |
| 40 | + overload(id: string): { one: number }; |
| 41 | +>overload : Symbol(Both.overload, Decl(intersectionOfCallsWithSameParameters.ts, 10, 32), Decl(intersectionOfCallsWithSameParameters.ts, 11, 42), Decl(intersectionOfCallsWithSameParameters.ts, 12, 42)) |
| 42 | +>id : Symbol(id, Decl(intersectionOfCallsWithSameParameters.ts, 12, 13)) |
| 43 | +>one : Symbol(one, Decl(intersectionOfCallsWithSameParameters.ts, 12, 27)) |
| 44 | + |
| 45 | + overload(id: string | number): { one: number, two: number } { |
| 46 | +>overload : Symbol(Both.overload, Decl(intersectionOfCallsWithSameParameters.ts, 10, 32), Decl(intersectionOfCallsWithSameParameters.ts, 11, 42), Decl(intersectionOfCallsWithSameParameters.ts, 12, 42)) |
| 47 | +>id : Symbol(id, Decl(intersectionOfCallsWithSameParameters.ts, 13, 13)) |
| 48 | +>one : Symbol(one, Decl(intersectionOfCallsWithSameParameters.ts, 13, 36)) |
| 49 | +>two : Symbol(two, Decl(intersectionOfCallsWithSameParameters.ts, 13, 49)) |
| 50 | + |
| 51 | + return { |
| 52 | + one: 1, |
| 53 | +>one : Symbol(one, Decl(intersectionOfCallsWithSameParameters.ts, 14, 16)) |
| 54 | + |
| 55 | + two: 2 |
| 56 | +>two : Symbol(two, Decl(intersectionOfCallsWithSameParameters.ts, 15, 19)) |
| 57 | + |
| 58 | + }; |
| 59 | + } |
| 60 | + |
| 61 | + intersect(id: string): { one: number, two: number } { |
| 62 | +>intersect : Symbol(Both.intersect, Decl(intersectionOfCallsWithSameParameters.ts, 18, 5)) |
| 63 | +>id : Symbol(id, Decl(intersectionOfCallsWithSameParameters.ts, 20, 14)) |
| 64 | +>one : Symbol(one, Decl(intersectionOfCallsWithSameParameters.ts, 20, 28)) |
| 65 | +>two : Symbol(two, Decl(intersectionOfCallsWithSameParameters.ts, 20, 41)) |
| 66 | + |
| 67 | + return { |
| 68 | + one: 1, |
| 69 | +>one : Symbol(one, Decl(intersectionOfCallsWithSameParameters.ts, 21, 16)) |
| 70 | + |
| 71 | + two: 2 |
| 72 | +>two : Symbol(two, Decl(intersectionOfCallsWithSameParameters.ts, 22, 19)) |
| 73 | + |
| 74 | + }; |
| 75 | + } |
| 76 | +} |
| 77 | + |
| 78 | +const b = new Both(); |
| 79 | +>b : Symbol(b, Decl(intersectionOfCallsWithSameParameters.ts, 28, 5)) |
| 80 | +>Both : Symbol(Both, Decl(intersectionOfCallsWithSameParameters.ts, 8, 1)) |
| 81 | + |
| 82 | +const intersect: { one: number, two: number } = b.intersect('test'); |
| 83 | +>intersect : Symbol(intersect, Decl(intersectionOfCallsWithSameParameters.ts, 29, 5)) |
| 84 | +>one : Symbol(one, Decl(intersectionOfCallsWithSameParameters.ts, 29, 18)) |
| 85 | +>two : Symbol(two, Decl(intersectionOfCallsWithSameParameters.ts, 29, 31)) |
| 86 | +>b.intersect : Symbol(Both.intersect, Decl(intersectionOfCallsWithSameParameters.ts, 18, 5)) |
| 87 | +>b : Symbol(b, Decl(intersectionOfCallsWithSameParameters.ts, 28, 5)) |
| 88 | +>intersect : Symbol(Both.intersect, Decl(intersectionOfCallsWithSameParameters.ts, 18, 5)) |
| 89 | + |
| 90 | +const overloadA: { one: number } = b.overload('test'); |
| 91 | +>overloadA : Symbol(overloadA, Decl(intersectionOfCallsWithSameParameters.ts, 30, 5)) |
| 92 | +>one : Symbol(one, Decl(intersectionOfCallsWithSameParameters.ts, 30, 18)) |
| 93 | +>b.overload : Symbol(Both.overload, Decl(intersectionOfCallsWithSameParameters.ts, 10, 32), Decl(intersectionOfCallsWithSameParameters.ts, 11, 42), Decl(intersectionOfCallsWithSameParameters.ts, 12, 42)) |
| 94 | +>b : Symbol(b, Decl(intersectionOfCallsWithSameParameters.ts, 28, 5)) |
| 95 | +>overload : Symbol(Both.overload, Decl(intersectionOfCallsWithSameParameters.ts, 10, 32), Decl(intersectionOfCallsWithSameParameters.ts, 11, 42), Decl(intersectionOfCallsWithSameParameters.ts, 12, 42)) |
| 96 | + |
| 97 | +const overloadB: { two: number } = b.overload(4); |
| 98 | +>overloadB : Symbol(overloadB, Decl(intersectionOfCallsWithSameParameters.ts, 31, 5)) |
| 99 | +>two : Symbol(two, Decl(intersectionOfCallsWithSameParameters.ts, 31, 18)) |
| 100 | +>b.overload : Symbol(Both.overload, Decl(intersectionOfCallsWithSameParameters.ts, 10, 32), Decl(intersectionOfCallsWithSameParameters.ts, 11, 42), Decl(intersectionOfCallsWithSameParameters.ts, 12, 42)) |
| 101 | +>b : Symbol(b, Decl(intersectionOfCallsWithSameParameters.ts, 28, 5)) |
| 102 | +>overload : Symbol(Both.overload, Decl(intersectionOfCallsWithSameParameters.ts, 10, 32), Decl(intersectionOfCallsWithSameParameters.ts, 11, 42), Decl(intersectionOfCallsWithSameParameters.ts, 12, 42)) |
| 103 | + |
| 104 | +const bAs: One & Two = b; |
| 105 | +>bAs : Symbol(bAs, Decl(intersectionOfCallsWithSameParameters.ts, 32, 5)) |
| 106 | +>One : Symbol(One, Decl(intersectionOfCallsWithSameParameters.ts, 0, 0)) |
| 107 | +>Two : Symbol(Two, Decl(intersectionOfCallsWithSameParameters.ts, 3, 1)) |
| 108 | +>b : Symbol(b, Decl(intersectionOfCallsWithSameParameters.ts, 28, 5)) |
| 109 | + |
| 110 | +const asIntersect: { one: number, two: number } = bAs.intersect('test'); |
| 111 | +>asIntersect : Symbol(asIntersect, Decl(intersectionOfCallsWithSameParameters.ts, 33, 5)) |
| 112 | +>one : Symbol(one, Decl(intersectionOfCallsWithSameParameters.ts, 33, 20)) |
| 113 | +>two : Symbol(two, Decl(intersectionOfCallsWithSameParameters.ts, 33, 33)) |
| 114 | +>bAs.intersect : Symbol(intersect, Decl(intersectionOfCallsWithSameParameters.ts, 1, 42), Decl(intersectionOfCallsWithSameParameters.ts, 6, 42)) |
| 115 | +>bAs : Symbol(bAs, Decl(intersectionOfCallsWithSameParameters.ts, 32, 5)) |
| 116 | +>intersect : Symbol(intersect, Decl(intersectionOfCallsWithSameParameters.ts, 1, 42), Decl(intersectionOfCallsWithSameParameters.ts, 6, 42)) |
| 117 | + |
| 118 | +const asOverloadA: { one: number } = bAs.overload('test'); |
| 119 | +>asOverloadA : Symbol(asOverloadA, Decl(intersectionOfCallsWithSameParameters.ts, 34, 5)) |
| 120 | +>one : Symbol(one, Decl(intersectionOfCallsWithSameParameters.ts, 34, 20)) |
| 121 | +>bAs.overload : Symbol(overload, Decl(intersectionOfCallsWithSameParameters.ts, 0, 15), Decl(intersectionOfCallsWithSameParameters.ts, 5, 15)) |
| 122 | +>bAs : Symbol(bAs, Decl(intersectionOfCallsWithSameParameters.ts, 32, 5)) |
| 123 | +>overload : Symbol(overload, Decl(intersectionOfCallsWithSameParameters.ts, 0, 15), Decl(intersectionOfCallsWithSameParameters.ts, 5, 15)) |
| 124 | + |
| 125 | +const asOverloadB: { two: number } = bAs.overload(4); |
| 126 | +>asOverloadB : Symbol(asOverloadB, Decl(intersectionOfCallsWithSameParameters.ts, 35, 5)) |
| 127 | +>two : Symbol(two, Decl(intersectionOfCallsWithSameParameters.ts, 35, 20)) |
| 128 | +>bAs.overload : Symbol(overload, Decl(intersectionOfCallsWithSameParameters.ts, 0, 15), Decl(intersectionOfCallsWithSameParameters.ts, 5, 15)) |
| 129 | +>bAs : Symbol(bAs, Decl(intersectionOfCallsWithSameParameters.ts, 32, 5)) |
| 130 | +>overload : Symbol(overload, Decl(intersectionOfCallsWithSameParameters.ts, 0, 15), Decl(intersectionOfCallsWithSameParameters.ts, 5, 15)) |
| 131 | + |
0 commit comments