|
| 1 | +//// [tests/cases/conformance/controlFlow/dependentDestructuredVariablesRefereinceInDeclaration1.ts] //// |
| 2 | + |
| 3 | +=== dependentDestructuredVariablesRefereinceInDeclaration1.ts === |
| 4 | +// https://github.com/microsoft/TypeScript/issues/62993 |
| 5 | + |
| 6 | +{ |
| 7 | + const { c, f }: string | number = { c: 0, f }; |
| 8 | +>c : Symbol(c, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 3, 9)) |
| 9 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 3, 12)) |
| 10 | +>c : Symbol(c, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 3, 37)) |
| 11 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 3, 43)) |
| 12 | + |
| 13 | + f; |
| 14 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 3, 12)) |
| 15 | +} |
| 16 | + |
| 17 | +{ |
| 18 | + const { c, f }: string | number = { c: 0, f: () => f }; |
| 19 | +>c : Symbol(c, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 8, 9)) |
| 20 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 8, 12)) |
| 21 | +>c : Symbol(c, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 8, 37)) |
| 22 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 8, 43)) |
| 23 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 8, 12)) |
| 24 | + |
| 25 | + f; |
| 26 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 8, 12)) |
| 27 | +} |
| 28 | + |
| 29 | +{ |
| 30 | + const { c, f, g = f }: string | number = { c: 0, f: 0, g: 0 }; |
| 31 | +>c : Symbol(c, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 13, 9)) |
| 32 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 13, 12)) |
| 33 | +>g : Symbol(g, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 13, 15)) |
| 34 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 13, 12)) |
| 35 | +>c : Symbol(c, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 13, 44)) |
| 36 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 13, 50)) |
| 37 | +>g : Symbol(g, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 13, 56)) |
| 38 | + |
| 39 | + f; |
| 40 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 13, 12)) |
| 41 | + |
| 42 | + g; |
| 43 | +>g : Symbol(g, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 13, 15)) |
| 44 | +} |
| 45 | + |
| 46 | +{ |
| 47 | + const { c, f }: { c: 0; f: number } | { c: 1; f: string } = { c: 0, f }; |
| 48 | +>c : Symbol(c, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 19, 9)) |
| 49 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 19, 12)) |
| 50 | +>c : Symbol(c, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 19, 19)) |
| 51 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 19, 25)) |
| 52 | +>c : Symbol(c, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 19, 41)) |
| 53 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 19, 47)) |
| 54 | +>c : Symbol(c, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 19, 63)) |
| 55 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 19, 69)) |
| 56 | + |
| 57 | + f; |
| 58 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 19, 12)) |
| 59 | +} |
| 60 | + |
| 61 | +{ |
| 62 | + const { c, f }: { c: 0; f: () => unknown } | { c: 1; f: string } = { |
| 63 | +>c : Symbol(c, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 24, 9)) |
| 64 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 24, 12)) |
| 65 | +>c : Symbol(c, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 24, 19)) |
| 66 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 24, 25)) |
| 67 | +>c : Symbol(c, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 24, 48)) |
| 68 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 24, 54)) |
| 69 | + |
| 70 | + c: 0, |
| 71 | +>c : Symbol(c, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 24, 70)) |
| 72 | + |
| 73 | + f: () => f, |
| 74 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 25, 9)) |
| 75 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 24, 12)) |
| 76 | + |
| 77 | + }; |
| 78 | + f; |
| 79 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 24, 12)) |
| 80 | +} |
| 81 | + |
| 82 | +{ |
| 83 | + const { |
| 84 | + c, |
| 85 | +>c : Symbol(c, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 32, 9)) |
| 86 | + |
| 87 | + f, |
| 88 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 33, 6)) |
| 89 | + |
| 90 | + g = f, |
| 91 | +>g : Symbol(g, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 34, 6)) |
| 92 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 33, 6)) |
| 93 | + |
| 94 | + }: |
| 95 | + | { c: 0; f: bigint; g?: bigint | number } |
| 96 | +>c : Symbol(c, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 37, 7)) |
| 97 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 37, 13)) |
| 98 | +>g : Symbol(g, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 37, 24)) |
| 99 | + |
| 100 | + | { c: 1; f: number; g: string } = { |
| 101 | +>c : Symbol(c, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 38, 7)) |
| 102 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 38, 13)) |
| 103 | +>g : Symbol(g, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 38, 24)) |
| 104 | + |
| 105 | + c: 0, |
| 106 | +>c : Symbol(c, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 38, 40)) |
| 107 | + |
| 108 | + f: 10n, |
| 109 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 39, 9)) |
| 110 | + |
| 111 | + }; |
| 112 | + f; |
| 113 | +>f : Symbol(f, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 33, 6)) |
| 114 | + |
| 115 | + g; |
| 116 | +>g : Symbol(g, Decl(dependentDestructuredVariablesRefereinceInDeclaration1.ts, 34, 6)) |
| 117 | +} |
| 118 | + |
0 commit comments