87d10eb055
* 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
44 lines
796 B
Plaintext
44 lines
796 B
Plaintext
=== tests/cases/conformance/es6/Symbols/symbolProperty15.ts ===
|
|
class C { }
|
|
>C : C
|
|
|
|
interface I {
|
|
[Symbol.iterator]?: { x };
|
|
>[Symbol.iterator] : { x: any; }
|
|
>Symbol.iterator : unique symbol
|
|
>Symbol : SymbolConstructor
|
|
>iterator : unique symbol
|
|
>x : any
|
|
}
|
|
|
|
declare function foo(i: I): I;
|
|
>foo : { (i: I): I; (a: any): any; }
|
|
>i : I
|
|
|
|
declare function foo(a: any): any;
|
|
>foo : { (i: I): I; (a: any): any; }
|
|
>a : any
|
|
|
|
declare function bar(i: C): C;
|
|
>bar : { (i: C): C; (a: any): any; }
|
|
>i : C
|
|
|
|
declare function bar(a: any): any;
|
|
>bar : { (i: C): C; (a: any): any; }
|
|
>a : any
|
|
|
|
foo(new C);
|
|
>foo(new C) : any
|
|
>foo : { (i: I): I; (a: any): any; }
|
|
>new C : C
|
|
>C : typeof C
|
|
|
|
var i: I;
|
|
>i : I
|
|
|
|
bar(i);
|
|
>bar(i) : C
|
|
>bar : { (i: C): C; (a: any): any; }
|
|
>i : I
|
|
|