2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/conformance/types/namedTypes/classWithOnlyPublicMembersEquivalentToInterface2.ts ===
|
|
|
|
// no errors expected
|
|
|
|
|
|
|
|
class C {
|
2015-04-16 01:44:20 +02:00
|
|
|
>C : C
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
public x: string;
|
2015-04-16 01:44:20 +02:00
|
|
|
>x : string
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
public y(a: number): number { return null; }
|
2015-04-16 01:44:20 +02:00
|
|
|
>y : (a: number) => number
|
|
|
|
>a : number
|
2015-04-13 21:36:11 +02:00
|
|
|
>null : null
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
public get z() { return 1; }
|
2015-04-16 01:44:20 +02:00
|
|
|
>z : number
|
2015-04-13 21:36:11 +02:00
|
|
|
>1 : number
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
public set z(v) { }
|
2015-04-16 01:44:20 +02:00
|
|
|
>z : number
|
|
|
|
>v : number
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
[x: string]: Object;
|
2015-04-16 01:44:20 +02:00
|
|
|
>x : string
|
|
|
|
>Object : Object
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
[x: number]: Object;
|
2015-04-16 01:44:20 +02:00
|
|
|
>x : number
|
|
|
|
>Object : Object
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
0: number;
|
|
|
|
|
|
|
|
public static foo: string; // doesn't effect equivalence
|
2015-04-16 01:44:20 +02:00
|
|
|
>foo : string
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
interface I {
|
2015-04-16 01:44:20 +02:00
|
|
|
>I : I
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
x: string;
|
2015-04-16 01:44:20 +02:00
|
|
|
>x : string
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
y(b: number): number;
|
2015-04-16 01:44:20 +02:00
|
|
|
>y : (b: number) => number
|
|
|
|
>b : number
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
z: number;
|
2015-04-16 01:44:20 +02:00
|
|
|
>z : number
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
[x: string]: Object;
|
2015-04-16 01:44:20 +02:00
|
|
|
>x : string
|
|
|
|
>Object : Object
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
[x: number]: Object;
|
2015-04-16 01:44:20 +02:00
|
|
|
>x : number
|
|
|
|
>Object : Object
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
0: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
var c: C;
|
2015-04-16 01:44:20 +02:00
|
|
|
>c : C
|
|
|
|
>C : C
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var i: I;
|
2015-04-16 01:44:20 +02:00
|
|
|
>i : I
|
|
|
|
>I : I
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
c = i;
|
|
|
|
>c = i : I
|
2015-04-16 01:44:20 +02:00
|
|
|
>c : C
|
|
|
|
>i : I
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
i = c;
|
|
|
|
>i = c : C
|
2015-04-16 01:44:20 +02:00
|
|
|
>i : I
|
|
|
|
>c : C
|
2014-08-15 23:33:16 +02:00
|
|
|
|