|
| 1 | +//// [tests/cases/conformance/controlFlow/dependentDestructuredVariablesWithExport.ts] //// |
| 2 | + |
| 3 | +=== dependentDestructuredVariablesWithExport.ts === |
| 4 | +// https://github.com/microsoft/TypeScript/issues/59652 |
| 5 | + |
| 6 | +declare function mutuallyEnabledPair(): { |
| 7 | +>mutuallyEnabledPair : Symbol(mutuallyEnabledPair, Decl(dependentDestructuredVariablesWithExport.ts, 0, 0)) |
| 8 | + |
| 9 | + discriminator: true, |
| 10 | +>discriminator : Symbol(discriminator, Decl(dependentDestructuredVariablesWithExport.ts, 2, 41)) |
| 11 | + |
| 12 | + value: string, |
| 13 | +>value : Symbol(value, Decl(dependentDestructuredVariablesWithExport.ts, 3, 24)) |
| 14 | + |
| 15 | + } | { |
| 16 | + discriminator: false, |
| 17 | +>discriminator : Symbol(discriminator, Decl(dependentDestructuredVariablesWithExport.ts, 5, 7)) |
| 18 | + |
| 19 | + value: null | undefined, |
| 20 | +>value : Symbol(value, Decl(dependentDestructuredVariablesWithExport.ts, 6, 25)) |
| 21 | + } |
| 22 | + |
| 23 | +const { discriminator: discriminator1, value: value1 } = mutuallyEnabledPair() |
| 24 | +>discriminator : Symbol(discriminator, Decl(dependentDestructuredVariablesWithExport.ts, 2, 41), Decl(dependentDestructuredVariablesWithExport.ts, 5, 7)) |
| 25 | +>discriminator1 : Symbol(discriminator1, Decl(dependentDestructuredVariablesWithExport.ts, 10, 7)) |
| 26 | +>value : Symbol(value, Decl(dependentDestructuredVariablesWithExport.ts, 3, 24), Decl(dependentDestructuredVariablesWithExport.ts, 6, 25)) |
| 27 | +>value1 : Symbol(value1, Decl(dependentDestructuredVariablesWithExport.ts, 10, 38)) |
| 28 | +>mutuallyEnabledPair : Symbol(mutuallyEnabledPair, Decl(dependentDestructuredVariablesWithExport.ts, 0, 0)) |
| 29 | + |
| 30 | +if (discriminator1) { |
| 31 | +>discriminator1 : Symbol(discriminator1, Decl(dependentDestructuredVariablesWithExport.ts, 10, 7)) |
| 32 | + |
| 33 | + value1; |
| 34 | +>value1 : Symbol(value1, Decl(dependentDestructuredVariablesWithExport.ts, 10, 38)) |
| 35 | +} |
| 36 | + |
| 37 | +export const { discriminator: discriminator2, value: value2 } = mutuallyEnabledPair() |
| 38 | +>discriminator : Symbol(discriminator, Decl(dependentDestructuredVariablesWithExport.ts, 2, 41), Decl(dependentDestructuredVariablesWithExport.ts, 5, 7)) |
| 39 | +>discriminator2 : Symbol(discriminator2, Decl(dependentDestructuredVariablesWithExport.ts, 16, 14)) |
| 40 | +>value : Symbol(value, Decl(dependentDestructuredVariablesWithExport.ts, 3, 24), Decl(dependentDestructuredVariablesWithExport.ts, 6, 25)) |
| 41 | +>value2 : Symbol(value2, Decl(dependentDestructuredVariablesWithExport.ts, 16, 45)) |
| 42 | +>mutuallyEnabledPair : Symbol(mutuallyEnabledPair, Decl(dependentDestructuredVariablesWithExport.ts, 0, 0)) |
| 43 | + |
| 44 | +if (discriminator2) { |
| 45 | +>discriminator2 : Symbol(discriminator2, Decl(dependentDestructuredVariablesWithExport.ts, 16, 14)) |
| 46 | + |
| 47 | + value2; |
| 48 | +>value2 : Symbol(value2, Decl(dependentDestructuredVariablesWithExport.ts, 16, 45)) |
| 49 | +} |
0 commit comments