68 lines
891 B
Text
68 lines
891 B
Text
|
=== tests/cases/compiler/m7Bugs.ts ===
|
||
|
// scenario 1
|
||
|
interface ISomething {
|
||
|
>ISomething : ISomething
|
||
|
|
||
|
something: number;
|
||
|
>something : number
|
||
|
}
|
||
|
|
||
|
var s: ISomething = <ISomething>({ });
|
||
|
>s : ISomething
|
||
|
>ISomething : ISomething
|
||
|
><ISomething>({ }) : ISomething
|
||
|
>ISomething : ISomething
|
||
|
>({ }) : {}
|
||
|
>{ } : {}
|
||
|
|
||
|
|
||
|
// scenario 2
|
||
|
interface A { x: string; }
|
||
|
>A : A
|
||
|
>x : string
|
||
|
|
||
|
interface B extends A { }
|
||
|
>B : B
|
||
|
>A : A
|
||
|
|
||
|
var x: B = <B>{ };
|
||
|
>x : B
|
||
|
>B : B
|
||
|
><B>{ } : B
|
||
|
>B : B
|
||
|
>{ } : {}
|
||
|
|
||
|
class C1 {
|
||
|
>C1 : C1
|
||
|
|
||
|
public x: string;
|
||
|
>x : string
|
||
|
}
|
||
|
|
||
|
class C2 extends C1 {}
|
||
|
>C2 : C2
|
||
|
>C1 : C1
|
||
|
|
||
|
var y1: C1 = new C2();
|
||
|
>y1 : C1
|
||
|
>C1 : C1
|
||
|
>new C2() : C2
|
||
|
>C2 : typeof C2
|
||
|
|
||
|
var y2: C1 = <C1> new C2();
|
||
|
>y2 : C1
|
||
|
>C1 : C1
|
||
|
><C1> new C2() : C1
|
||
|
>C1 : C1
|
||
|
>new C2() : C2
|
||
|
>C2 : typeof C2
|
||
|
|
||
|
var y3: C1 = <C1> {};
|
||
|
>y3 : C1
|
||
|
>C1 : C1
|
||
|
><C1> {} : C1
|
||
|
>C1 : C1
|
||
|
>{} : {}
|
||
|
|
||
|
|