37 lines
396 B
Plaintext
37 lines
396 B
Plaintext
|
=== tests/cases/compiler/varAsID.ts ===
|
||
|
|
||
|
class Foo {
|
||
|
>Foo : Foo
|
||
|
|
||
|
var; // ok
|
||
|
>var : any
|
||
|
|
||
|
x=1;
|
||
|
>x : number
|
||
|
}
|
||
|
|
||
|
var f = new Foo();
|
||
|
>f : Foo
|
||
|
>new Foo() : Foo
|
||
|
>Foo : typeof Foo
|
||
|
|
||
|
|
||
|
class Foo2 {
|
||
|
>Foo2 : Foo2
|
||
|
|
||
|
var // not an error, because of ASI.
|
||
|
>var : any
|
||
|
|
||
|
x=1;
|
||
|
>x : number
|
||
|
}
|
||
|
|
||
|
var f2 = new Foo2();
|
||
|
>f2 : Foo2
|
||
|
>new Foo2() : Foo2
|
||
|
>Foo2 : typeof Foo2
|
||
|
|
||
|
|
||
|
|
||
|
|