TypeScript/tests/baselines/reference/typeMatch1.errors.txt

39 lines
1.3 KiB
Plaintext
Raw Normal View History

2014-11-05 21:26:03 +01:00
tests/cases/compiler/typeMatch1.ts(18,1): error TS2322: Type 'D' is not assignable to type 'C'.
Types have separate declarations of a private property 'x'.
2014-11-05 21:26:03 +01:00
tests/cases/compiler/typeMatch1.ts(19,1): error TS2322: Type 'typeof C' is not assignable to type 'C'.
Property 'x' is missing in type 'typeof C'.
tests/cases/compiler/typeMatch1.ts(20,1): error TS2365: Operator '==' cannot be applied to types 'typeof C' and 'typeof D'.
2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/typeMatch1.ts (3 errors) ====
interface I { z; }
interface I2 { z; }
var x1: { z: number; f(n: number): string; f(s: string): number; }
var x2: { z:number;f:{(n:number):string;(s:string):number;}; } = x1;
var i:I;
var i2:I2;
var x3:{ z; }= i;
var x4:{ z; }= i2;
var x5:I=i2;
class C { private x; }
class D { private x; }
var x6=new C();
var x7=new D();
x6 = x7;
~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'D' is not assignable to type 'C'.
!!! error TS2322: Types have separate declarations of a private property 'x'.
2014-07-13 01:04:16 +02:00
x6=C;
~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'typeof C' is not assignable to type 'C'.
!!! error TS2322: Property 'x' is missing in type 'typeof C'.
2014-07-13 01:04:16 +02:00
C==D;
~~~~
!!! error TS2365: Operator '==' cannot be applied to types 'typeof C' and 'typeof D'.
2014-07-13 01:04:16 +02:00
C==C;