75 lines
976 B
Text
75 lines
976 B
Text
=== tests/cases/conformance/types/namedTypes/classWithOnlyPublicMembersEquivalentToInterface.ts ===
|
|
// no errors expected
|
|
|
|
class C {
|
|
>C : C
|
|
|
|
public x: string;
|
|
>x : string
|
|
|
|
public y(a: number): number { return null; }
|
|
>y : (a: number) => number
|
|
>a : number
|
|
>null : null
|
|
|
|
public get z() { return 1; }
|
|
>z : number
|
|
>1 : number
|
|
|
|
public set z(v) { }
|
|
>z : number
|
|
>v : number
|
|
|
|
[x: string]: Object;
|
|
>x : string
|
|
>Object : Object
|
|
|
|
[x: number]: Object;
|
|
>x : number
|
|
>Object : Object
|
|
|
|
0: number;
|
|
}
|
|
|
|
interface I {
|
|
>I : I
|
|
|
|
x: string;
|
|
>x : string
|
|
|
|
y(b: number): number;
|
|
>y : (b: number) => number
|
|
>b : number
|
|
|
|
z: number;
|
|
>z : number
|
|
|
|
[x: string]: Object;
|
|
>x : string
|
|
>Object : Object
|
|
|
|
[x: number]: Object;
|
|
>x : number
|
|
>Object : Object
|
|
|
|
0: number;
|
|
}
|
|
|
|
var c: C;
|
|
>c : C
|
|
>C : C
|
|
|
|
var i: I;
|
|
>i : I
|
|
>I : I
|
|
|
|
c = i;
|
|
>c = i : I
|
|
>c : C
|
|
>i : I
|
|
|
|
i = c;
|
|
>i = c : C
|
|
>i : I
|
|
>c : C
|
|
|