35 lines
481 B
Text
35 lines
481 B
Text
=== tests/cases/compiler/defaultIndexProps2.ts ===
|
|
class Foo {
|
|
>Foo : Foo
|
|
|
|
public v = "Yo";
|
|
>v : string
|
|
>"Yo" : string
|
|
}
|
|
|
|
var f = new Foo();
|
|
>f : Foo
|
|
>new Foo() : Foo
|
|
>Foo : typeof Foo
|
|
|
|
// WScript.Echo(f[0]);
|
|
|
|
var o = {v:"Yo2"};
|
|
>o : { v: string; }
|
|
>{v:"Yo2"} : { v: string; }
|
|
>v : string
|
|
>"Yo2" : string
|
|
|
|
// WScript.Echo(o[0]);
|
|
|
|
1[0];
|
|
>1[0] : any
|
|
>1 : number
|
|
>0 : number
|
|
|
|
var q = "s"[0];
|
|
>q : string
|
|
>"s"[0] : string
|
|
>"s" : string
|
|
>0 : number
|
|
|