|
| 1 | +=== tests/cases/compiler/compareTypeSignaturesWithOptionalParameters.ts === |
| 2 | +let x1: (a?: {b?:number, c?:number}) => void; |
| 3 | +>x1 : Symbol(x1, Decl(compareTypeSignaturesWithOptionalParameters.ts, 0, 3)) |
| 4 | +>a : Symbol(a, Decl(compareTypeSignaturesWithOptionalParameters.ts, 0, 9)) |
| 5 | +>b : Symbol(b, Decl(compareTypeSignaturesWithOptionalParameters.ts, 0, 14)) |
| 6 | +>c : Symbol(c, Decl(compareTypeSignaturesWithOptionalParameters.ts, 0, 24)) |
| 7 | + |
| 8 | +x1 = ({b = 1, c = 2} = {}) => {}; |
| 9 | +>x1 : Symbol(x1, Decl(compareTypeSignaturesWithOptionalParameters.ts, 0, 3)) |
| 10 | +>b : Symbol(b, Decl(compareTypeSignaturesWithOptionalParameters.ts, 1, 7)) |
| 11 | +>c : Symbol(c, Decl(compareTypeSignaturesWithOptionalParameters.ts, 1, 13)) |
| 12 | + |
| 13 | +const x2 = ({b = 1, c = 2} = {}) => {}; |
| 14 | +>x2 : Symbol(x2, Decl(compareTypeSignaturesWithOptionalParameters.ts, 2, 5)) |
| 15 | +>b : Symbol(b, Decl(compareTypeSignaturesWithOptionalParameters.ts, 2, 13)) |
| 16 | +>c : Symbol(c, Decl(compareTypeSignaturesWithOptionalParameters.ts, 2, 19)) |
| 17 | + |
| 18 | +x1 = x2; |
| 19 | +>x1 : Symbol(x1, Decl(compareTypeSignaturesWithOptionalParameters.ts, 0, 3)) |
| 20 | +>x2 : Symbol(x2, Decl(compareTypeSignaturesWithOptionalParameters.ts, 2, 5)) |
| 21 | + |
| 22 | +let x3: (a?: {b?:number, c?:{d?:number, e?:number}}) => void; |
| 23 | +>x3 : Symbol(x3, Decl(compareTypeSignaturesWithOptionalParameters.ts, 5, 3)) |
| 24 | +>a : Symbol(a, Decl(compareTypeSignaturesWithOptionalParameters.ts, 5, 9)) |
| 25 | +>b : Symbol(b, Decl(compareTypeSignaturesWithOptionalParameters.ts, 5, 14)) |
| 26 | +>c : Symbol(c, Decl(compareTypeSignaturesWithOptionalParameters.ts, 5, 24)) |
| 27 | +>d : Symbol(d, Decl(compareTypeSignaturesWithOptionalParameters.ts, 5, 29)) |
| 28 | +>e : Symbol(e, Decl(compareTypeSignaturesWithOptionalParameters.ts, 5, 39)) |
| 29 | + |
| 30 | +x3 = ({b = 1, c:{d = 2, e = 3} = {}} = {}) => {}; |
| 31 | +>x3 : Symbol(x3, Decl(compareTypeSignaturesWithOptionalParameters.ts, 5, 3)) |
| 32 | +>b : Symbol(b, Decl(compareTypeSignaturesWithOptionalParameters.ts, 6, 7)) |
| 33 | +>d : Symbol(d, Decl(compareTypeSignaturesWithOptionalParameters.ts, 6, 17)) |
| 34 | +>e : Symbol(e, Decl(compareTypeSignaturesWithOptionalParameters.ts, 6, 23)) |
| 35 | + |
| 36 | +const x4 = ({b = 1, c:{d = 2, e = 3} = {}} = {}) => {}; |
| 37 | +>x4 : Symbol(x4, Decl(compareTypeSignaturesWithOptionalParameters.ts, 7, 5)) |
| 38 | +>b : Symbol(b, Decl(compareTypeSignaturesWithOptionalParameters.ts, 7, 13)) |
| 39 | +>c : Symbol(c) |
| 40 | +>d : Symbol(d, Decl(compareTypeSignaturesWithOptionalParameters.ts, 7, 23)) |
| 41 | +>e : Symbol(e, Decl(compareTypeSignaturesWithOptionalParameters.ts, 7, 29)) |
| 42 | + |
| 43 | +x3 = x4; |
| 44 | +>x3 : Symbol(x3, Decl(compareTypeSignaturesWithOptionalParameters.ts, 5, 3)) |
| 45 | +>x4 : Symbol(x4, Decl(compareTypeSignaturesWithOptionalParameters.ts, 7, 5)) |
| 46 | + |
| 47 | +let x5: (a?: {b?:number, c?:{d?:{f?:number, g?:number}, e?:number}}) => void; |
| 48 | +>x5 : Symbol(x5, Decl(compareTypeSignaturesWithOptionalParameters.ts, 10, 3)) |
| 49 | +>a : Symbol(a, Decl(compareTypeSignaturesWithOptionalParameters.ts, 10, 9)) |
| 50 | +>b : Symbol(b, Decl(compareTypeSignaturesWithOptionalParameters.ts, 10, 14)) |
| 51 | +>c : Symbol(c, Decl(compareTypeSignaturesWithOptionalParameters.ts, 10, 24)) |
| 52 | +>d : Symbol(d, Decl(compareTypeSignaturesWithOptionalParameters.ts, 10, 29)) |
| 53 | +>f : Symbol(f, Decl(compareTypeSignaturesWithOptionalParameters.ts, 10, 33)) |
| 54 | +>g : Symbol(g, Decl(compareTypeSignaturesWithOptionalParameters.ts, 10, 43)) |
| 55 | +>e : Symbol(e, Decl(compareTypeSignaturesWithOptionalParameters.ts, 10, 55)) |
| 56 | + |
| 57 | +x5 = ({b = 1, c:{d:{f = 4, g = 5} = {}, e = 3} = {}} = {}) => {}; |
| 58 | +>x5 : Symbol(x5, Decl(compareTypeSignaturesWithOptionalParameters.ts, 10, 3)) |
| 59 | +>b : Symbol(b, Decl(compareTypeSignaturesWithOptionalParameters.ts, 11, 7)) |
| 60 | +>d : Symbol(d, Decl(compareTypeSignaturesWithOptionalParameters.ts, 10, 29)) |
| 61 | +>f : Symbol(f, Decl(compareTypeSignaturesWithOptionalParameters.ts, 11, 20)) |
| 62 | +>g : Symbol(g, Decl(compareTypeSignaturesWithOptionalParameters.ts, 11, 26)) |
| 63 | +>e : Symbol(e, Decl(compareTypeSignaturesWithOptionalParameters.ts, 11, 39)) |
| 64 | + |
| 65 | +const x6 = ({b = 1, c:{d:{f = 4, g = 5} = {}, e = 3} = {}} = {}) => {}; |
| 66 | +>x6 : Symbol(x6, Decl(compareTypeSignaturesWithOptionalParameters.ts, 12, 5)) |
| 67 | +>b : Symbol(b, Decl(compareTypeSignaturesWithOptionalParameters.ts, 12, 13)) |
| 68 | +>c : Symbol(c) |
| 69 | +>f : Symbol(f, Decl(compareTypeSignaturesWithOptionalParameters.ts, 12, 26)) |
| 70 | +>g : Symbol(g, Decl(compareTypeSignaturesWithOptionalParameters.ts, 12, 32)) |
| 71 | +>e : Symbol(e, Decl(compareTypeSignaturesWithOptionalParameters.ts, 12, 45)) |
| 72 | + |
| 73 | +x5 = x6; |
| 74 | +>x5 : Symbol(x5, Decl(compareTypeSignaturesWithOptionalParameters.ts, 10, 3)) |
| 75 | +>x6 : Symbol(x6, Decl(compareTypeSignaturesWithOptionalParameters.ts, 12, 5)) |
| 76 | + |
| 77 | +let useImplementation1 = true; |
| 78 | +>useImplementation1 : Symbol(useImplementation1, Decl(compareTypeSignaturesWithOptionalParameters.ts, 15, 3)) |
| 79 | + |
| 80 | +let someOtherFunctionOfThisType = ({a = 3, b = 4} = {}) => a + b; |
| 81 | +>someOtherFunctionOfThisType : Symbol(someOtherFunctionOfThisType, Decl(compareTypeSignaturesWithOptionalParameters.ts, 16, 3)) |
| 82 | +>a : Symbol(a, Decl(compareTypeSignaturesWithOptionalParameters.ts, 16, 36)) |
| 83 | +>b : Symbol(b, Decl(compareTypeSignaturesWithOptionalParameters.ts, 16, 42)) |
| 84 | +>a : Symbol(a, Decl(compareTypeSignaturesWithOptionalParameters.ts, 16, 36)) |
| 85 | +>b : Symbol(b, Decl(compareTypeSignaturesWithOptionalParameters.ts, 16, 42)) |
| 86 | + |
| 87 | +let adder: (nums?: {a?:number, b?:number}) => number; |
| 88 | +>adder : Symbol(adder, Decl(compareTypeSignaturesWithOptionalParameters.ts, 17, 3)) |
| 89 | +>nums : Symbol(nums, Decl(compareTypeSignaturesWithOptionalParameters.ts, 17, 12)) |
| 90 | +>a : Symbol(a, Decl(compareTypeSignaturesWithOptionalParameters.ts, 17, 20)) |
| 91 | +>b : Symbol(b, Decl(compareTypeSignaturesWithOptionalParameters.ts, 17, 30)) |
| 92 | + |
| 93 | +if (useImplementation1) { |
| 94 | +>useImplementation1 : Symbol(useImplementation1, Decl(compareTypeSignaturesWithOptionalParameters.ts, 15, 3)) |
| 95 | + |
| 96 | + adder = ({a = 1, b = 2} = {}) => a + b; |
| 97 | +>adder : Symbol(adder, Decl(compareTypeSignaturesWithOptionalParameters.ts, 17, 3)) |
| 98 | +>a : Symbol(a, Decl(compareTypeSignaturesWithOptionalParameters.ts, 19, 12)) |
| 99 | +>b : Symbol(b, Decl(compareTypeSignaturesWithOptionalParameters.ts, 19, 18)) |
| 100 | +>a : Symbol(a, Decl(compareTypeSignaturesWithOptionalParameters.ts, 19, 12)) |
| 101 | +>b : Symbol(b, Decl(compareTypeSignaturesWithOptionalParameters.ts, 19, 18)) |
| 102 | + |
| 103 | +} else { |
| 104 | + adder = someOtherFunctionOfThisType; |
| 105 | +>adder : Symbol(adder, Decl(compareTypeSignaturesWithOptionalParameters.ts, 17, 3)) |
| 106 | +>someOtherFunctionOfThisType : Symbol(someOtherFunctionOfThisType, Decl(compareTypeSignaturesWithOptionalParameters.ts, 16, 3)) |
| 107 | +} |
| 108 | + |
0 commit comments