TypeScript/tests/baselines/reference/symbolProperty40.types

51 lines
1 KiB
Plaintext
Raw Normal View History

2015-02-06 02:18:32 +01:00
=== tests/cases/conformance/es6/Symbols/symbolProperty40.ts ===
class C {
>C : C
2015-02-06 02:18:32 +01:00
[Symbol.iterator](x: string): string;
>Symbol.iterator : symbol
>Symbol : SymbolConstructor
>iterator : symbol
>x : string
2015-02-06 02:18:32 +01:00
[Symbol.iterator](x: number): number;
>Symbol.iterator : symbol
>Symbol : SymbolConstructor
>iterator : symbol
>x : number
2015-02-06 02:18:32 +01:00
[Symbol.iterator](x: any) {
>Symbol.iterator : symbol
>Symbol : SymbolConstructor
>iterator : symbol
>x : any
2015-02-06 02:18:32 +01:00
return undefined;
>undefined : undefined
2015-02-06 02:18:32 +01:00
}
}
var c = new C;
>c : C
2015-02-06 02:18:32 +01:00
>new C : C
>C : typeof C
2015-02-06 02:18:32 +01:00
c[Symbol.iterator]("");
>c[Symbol.iterator]("") : string
>c[Symbol.iterator] : { (x: string): string; (x: number): number; }
>c : C
>Symbol.iterator : symbol
>Symbol : SymbolConstructor
>iterator : symbol
2015-04-13 21:36:11 +02:00
>"" : string
2015-02-06 02:18:32 +01:00
c[Symbol.iterator](0);
>c[Symbol.iterator](0) : number
>c[Symbol.iterator] : { (x: string): string; (x: number): number; }
>c : C
>Symbol.iterator : symbol
>Symbol : SymbolConstructor
>iterator : symbol
2015-04-13 21:36:11 +02:00
>0 : number
2015-02-06 02:18:32 +01:00