TypeScript/tests/baselines/reference/symbolObserverMismatchingPolyfillsWorkTogether.symbols
Wesley Wigham 87d10eb055
Eliminate well known symbols as a concept in the checker and rely on unique symbols (#42543)
* Eliminate well-known symbols in the checker: 2021 edition

* Actually update the lib text to say unique symbol, too (this is unneeded with compat code in place, but this makes goto-def make more sense)

* Add test showing mismatched symbol constructor type interop

* Add more test cases for some other related issues this fixes

* Revert computed name change

* Style comments
2021-02-22 14:43:28 -08:00

25 lines
1.9 KiB
Plaintext

=== tests/cases/compiler/symbolObserverMismatchingPolyfillsWorkTogether.ts ===
interface SymbolConstructor {
>SymbolConstructor : Symbol(SymbolConstructor, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(symbolObserverMismatchingPolyfillsWorkTogether.ts, 0, 0), Decl(symbolObserverMismatchingPolyfillsWorkTogether.ts, 2, 1))
readonly observer: symbol;
>observer : Symbol(SymbolConstructor.observer, Decl(symbolObserverMismatchingPolyfillsWorkTogether.ts, 0, 29), Decl(symbolObserverMismatchingPolyfillsWorkTogether.ts, 3, 29))
}
interface SymbolConstructor {
>SymbolConstructor : Symbol(SymbolConstructor, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(symbolObserverMismatchingPolyfillsWorkTogether.ts, 0, 0), Decl(symbolObserverMismatchingPolyfillsWorkTogether.ts, 2, 1))
readonly observer: unique symbol;
>observer : Symbol(SymbolConstructor.observer, Decl(symbolObserverMismatchingPolyfillsWorkTogether.ts, 0, 29), Decl(symbolObserverMismatchingPolyfillsWorkTogether.ts, 3, 29))
}
const obj = {
>obj : Symbol(obj, Decl(symbolObserverMismatchingPolyfillsWorkTogether.ts, 7, 5))
[Symbol.observer]: 0
>[Symbol.observer] : Symbol([Symbol.observer], Decl(symbolObserverMismatchingPolyfillsWorkTogether.ts, 7, 13))
>Symbol.observer : Symbol(SymbolConstructor.observer, Decl(symbolObserverMismatchingPolyfillsWorkTogether.ts, 0, 29), Decl(symbolObserverMismatchingPolyfillsWorkTogether.ts, 3, 29))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
>observer : Symbol(SymbolConstructor.observer, Decl(symbolObserverMismatchingPolyfillsWorkTogether.ts, 0, 29), Decl(symbolObserverMismatchingPolyfillsWorkTogether.ts, 3, 29))
};