|
| 1 | +//// [tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsPropertyNames.ts] //// |
| 2 | + |
| 3 | +=== uniqueSymbolsPropertyNames.ts === |
| 4 | +interface OpTypes { |
| 5 | +>OpTypes : Symbol(OpTypes, Decl(uniqueSymbolsPropertyNames.ts, 0, 0)) |
| 6 | + |
| 7 | + readonly equal: unique symbol; |
| 8 | +>equal : Symbol(OpTypes.equal, Decl(uniqueSymbolsPropertyNames.ts, 0, 19)) |
| 9 | +} |
| 10 | + |
| 11 | +namespace OpNamespace { |
| 12 | +>OpNamespace : Symbol(OpNamespace, Decl(uniqueSymbolsPropertyNames.ts, 2, 1)) |
| 13 | + |
| 14 | + export declare const equal: unique symbol; |
| 15 | +>equal : Symbol(equal, Decl(uniqueSymbolsPropertyNames.ts, 5, 22)) |
| 16 | +} |
| 17 | + |
| 18 | +const uniqueSymbol0 = Symbol.for(""); |
| 19 | +>uniqueSymbol0 : Symbol(uniqueSymbol0, Decl(uniqueSymbolsPropertyNames.ts, 8, 5)) |
| 20 | +>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es2015.symbol.d.ts, --, --)) |
| 21 | +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --)) |
| 22 | +>for : Symbol(SymbolConstructor.for, Decl(lib.es2015.symbol.d.ts, --, --)) |
| 23 | + |
| 24 | +const uniqueSymbol1 = Symbol.for(""); |
| 25 | +>uniqueSymbol1 : Symbol(uniqueSymbol1, Decl(uniqueSymbolsPropertyNames.ts, 9, 5)) |
| 26 | +>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es2015.symbol.d.ts, --, --)) |
| 27 | +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --)) |
| 28 | +>for : Symbol(SymbolConstructor.for, Decl(lib.es2015.symbol.d.ts, --, --)) |
| 29 | + |
| 30 | + |
| 31 | +function getUniqueSymbol0(): typeof uniqueSymbol0 { |
| 32 | +>getUniqueSymbol0 : Symbol(getUniqueSymbol0, Decl(uniqueSymbolsPropertyNames.ts, 9, 37)) |
| 33 | +>uniqueSymbol0 : Symbol(uniqueSymbol0, Decl(uniqueSymbolsPropertyNames.ts, 8, 5)) |
| 34 | + |
| 35 | + return uniqueSymbol0; |
| 36 | +>uniqueSymbol0 : Symbol(uniqueSymbol0, Decl(uniqueSymbolsPropertyNames.ts, 8, 5)) |
| 37 | +} |
| 38 | + |
| 39 | +function getUniqueSymbol1(): typeof uniqueSymbol1 { |
| 40 | +>getUniqueSymbol1 : Symbol(getUniqueSymbol1, Decl(uniqueSymbolsPropertyNames.ts, 14, 1)) |
| 41 | +>uniqueSymbol1 : Symbol(uniqueSymbol1, Decl(uniqueSymbolsPropertyNames.ts, 9, 5)) |
| 42 | + |
| 43 | + return uniqueSymbol1; |
| 44 | +>uniqueSymbol1 : Symbol(uniqueSymbol1, Decl(uniqueSymbolsPropertyNames.ts, 9, 5)) |
| 45 | + } |
| 46 | + |
| 47 | +const Op: OpTypes = { |
| 48 | +>Op : Symbol(Op, Decl(uniqueSymbolsPropertyNames.ts, 20, 5)) |
| 49 | +>OpTypes : Symbol(OpTypes, Decl(uniqueSymbolsPropertyNames.ts, 0, 0)) |
| 50 | + |
| 51 | + equal: Symbol.for("equal"), |
| 52 | +>equal : Symbol(equal, Decl(uniqueSymbolsPropertyNames.ts, 20, 21)) |
| 53 | +>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es2015.symbol.d.ts, --, --)) |
| 54 | +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --)) |
| 55 | +>for : Symbol(SymbolConstructor.for, Decl(lib.es2015.symbol.d.ts, --, --)) |
| 56 | + |
| 57 | +} as OpTypes; |
| 58 | +>OpTypes : Symbol(OpTypes, Decl(uniqueSymbolsPropertyNames.ts, 0, 0)) |
| 59 | + |
| 60 | +const t0 = { |
| 61 | +>t0 : Symbol(t0, Decl(uniqueSymbolsPropertyNames.ts, 24, 5)) |
| 62 | + |
| 63 | + equal: "first", |
| 64 | +>equal : Symbol(equal, Decl(uniqueSymbolsPropertyNames.ts, 24, 12), Decl(uniqueSymbolsPropertyNames.ts, 25, 17), Decl(uniqueSymbolsPropertyNames.ts, 26, 18)) |
| 65 | + |
| 66 | + equal: "second", |
| 67 | +>equal : Symbol(equal, Decl(uniqueSymbolsPropertyNames.ts, 24, 12), Decl(uniqueSymbolsPropertyNames.ts, 25, 17), Decl(uniqueSymbolsPropertyNames.ts, 26, 18)) |
| 68 | + |
| 69 | + ["equal"]: "last", |
| 70 | +>["equal"] : Symbol(equal, Decl(uniqueSymbolsPropertyNames.ts, 24, 12), Decl(uniqueSymbolsPropertyNames.ts, 25, 17), Decl(uniqueSymbolsPropertyNames.ts, 26, 18)) |
| 71 | +>"equal" : Symbol(equal, Decl(uniqueSymbolsPropertyNames.ts, 24, 12), Decl(uniqueSymbolsPropertyNames.ts, 25, 17), Decl(uniqueSymbolsPropertyNames.ts, 26, 18)) |
| 72 | + |
| 73 | +}; |
| 74 | + |
| 75 | +const t1 = { |
| 76 | +>t1 : Symbol(t1, Decl(uniqueSymbolsPropertyNames.ts, 30, 5)) |
| 77 | + |
| 78 | + [Op.equal]: "first", |
| 79 | +>[Op.equal] : Symbol([Op.equal], Decl(uniqueSymbolsPropertyNames.ts, 30, 12), Decl(uniqueSymbolsPropertyNames.ts, 31, 22)) |
| 80 | +>Op.equal : Symbol(OpTypes.equal, Decl(uniqueSymbolsPropertyNames.ts, 0, 19)) |
| 81 | +>Op : Symbol(Op, Decl(uniqueSymbolsPropertyNames.ts, 20, 5)) |
| 82 | +>equal : Symbol(OpTypes.equal, Decl(uniqueSymbolsPropertyNames.ts, 0, 19)) |
| 83 | + |
| 84 | + [Op.equal]: "last", |
| 85 | +>[Op.equal] : Symbol([Op.equal], Decl(uniqueSymbolsPropertyNames.ts, 30, 12), Decl(uniqueSymbolsPropertyNames.ts, 31, 22)) |
| 86 | +>Op.equal : Symbol(OpTypes.equal, Decl(uniqueSymbolsPropertyNames.ts, 0, 19)) |
| 87 | +>Op : Symbol(Op, Decl(uniqueSymbolsPropertyNames.ts, 20, 5)) |
| 88 | +>equal : Symbol(OpTypes.equal, Decl(uniqueSymbolsPropertyNames.ts, 0, 19)) |
| 89 | + |
| 90 | +}; |
| 91 | + |
| 92 | +const t2 = { |
| 93 | +>t2 : Symbol(t2, Decl(uniqueSymbolsPropertyNames.ts, 35, 5)) |
| 94 | + |
| 95 | + [OpNamespace.equal]: "first", |
| 96 | +>[OpNamespace.equal] : Symbol([OpNamespace.equal], Decl(uniqueSymbolsPropertyNames.ts, 35, 12), Decl(uniqueSymbolsPropertyNames.ts, 36, 31)) |
| 97 | +>OpNamespace.equal : Symbol(OpNamespace.equal, Decl(uniqueSymbolsPropertyNames.ts, 5, 22)) |
| 98 | +>OpNamespace : Symbol(OpNamespace, Decl(uniqueSymbolsPropertyNames.ts, 2, 1)) |
| 99 | +>equal : Symbol(OpNamespace.equal, Decl(uniqueSymbolsPropertyNames.ts, 5, 22)) |
| 100 | + |
| 101 | + [OpNamespace.equal]: "last", |
| 102 | +>[OpNamespace.equal] : Symbol([OpNamespace.equal], Decl(uniqueSymbolsPropertyNames.ts, 35, 12), Decl(uniqueSymbolsPropertyNames.ts, 36, 31)) |
| 103 | +>OpNamespace.equal : Symbol(OpNamespace.equal, Decl(uniqueSymbolsPropertyNames.ts, 5, 22)) |
| 104 | +>OpNamespace : Symbol(OpNamespace, Decl(uniqueSymbolsPropertyNames.ts, 2, 1)) |
| 105 | +>equal : Symbol(OpNamespace.equal, Decl(uniqueSymbolsPropertyNames.ts, 5, 22)) |
| 106 | + |
| 107 | +}; |
| 108 | + |
| 109 | +const t3 = { |
| 110 | +>t3 : Symbol(t3, Decl(uniqueSymbolsPropertyNames.ts, 40, 5)) |
| 111 | + |
| 112 | + [getUniqueSymbol0()]: "first", |
| 113 | +>[getUniqueSymbol0()] : Symbol([getUniqueSymbol0()], Decl(uniqueSymbolsPropertyNames.ts, 40, 12)) |
| 114 | +>getUniqueSymbol0 : Symbol(getUniqueSymbol0, Decl(uniqueSymbolsPropertyNames.ts, 9, 37)) |
| 115 | + |
| 116 | + [getUniqueSymbol0()]: "last", |
| 117 | +>[getUniqueSymbol0()] : Symbol([getUniqueSymbol0()], Decl(uniqueSymbolsPropertyNames.ts, 41, 32)) |
| 118 | +>getUniqueSymbol0 : Symbol(getUniqueSymbol0, Decl(uniqueSymbolsPropertyNames.ts, 9, 37)) |
| 119 | + |
| 120 | + [getUniqueSymbol1()]: "first", |
| 121 | +>[getUniqueSymbol1()] : Symbol([getUniqueSymbol1()], Decl(uniqueSymbolsPropertyNames.ts, 42, 31)) |
| 122 | +>getUniqueSymbol1 : Symbol(getUniqueSymbol1, Decl(uniqueSymbolsPropertyNames.ts, 14, 1)) |
| 123 | + |
| 124 | + [getUniqueSymbol1()]: "last", |
| 125 | +>[getUniqueSymbol1()] : Symbol([getUniqueSymbol1()], Decl(uniqueSymbolsPropertyNames.ts, 43, 32)) |
| 126 | +>getUniqueSymbol1 : Symbol(getUniqueSymbol1, Decl(uniqueSymbolsPropertyNames.ts, 14, 1)) |
| 127 | + |
| 128 | +}; |
| 129 | + |
0 commit comments