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

60 lines
1.9 KiB
Plaintext
Raw Normal View History

2014-11-05 21:26:03 +01:00
tests/cases/compiler/enumAssignmentCompat.ts(26,5): error TS2322: Type 'typeof W' is not assignable to type 'number'.
tests/cases/compiler/enumAssignmentCompat.ts(28,5): error TS2322: Type 'W' is not assignable to type 'typeof W'.
Property 'D' is missing in type 'Number'.
2014-11-05 21:26:03 +01:00
tests/cases/compiler/enumAssignmentCompat.ts(30,5): error TS2322: Type 'number' is not assignable to type 'typeof W'.
tests/cases/compiler/enumAssignmentCompat.ts(32,5): error TS2322: Type 'W' is not assignable to type 'WStatic'.
Property 'a' is missing in type 'Number'.
2014-11-05 21:26:03 +01:00
tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type 'number' is not assignable to type 'WStatic'.
2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/enumAssignmentCompat.ts (5 errors) ====
module W {
export class D { }
}
enum W {
a, b, c,
}
interface WStatic {
a: W;
b: W;
c: W;
}
var x: WStatic = W;
var y: typeof W = W;
var z: number = W; // error
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'typeof W' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
var a: number = W.a;
var b: typeof W = W.a; // error
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'W' is not assignable to type 'typeof W'.
!!! error TS2322: Property 'D' is missing in type 'Number'.
2014-07-13 01:04:16 +02:00
var c: typeof W.a = W.a;
var d: typeof W = 3; // error
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'number' is not assignable to type 'typeof W'.
2014-07-13 01:04:16 +02:00
var e: typeof W.a = 4;
var f: WStatic = W.a; // error
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'W' is not assignable to type 'WStatic'.
!!! error TS2322: Property 'a' is missing in type 'Number'.
2014-07-13 01:04:16 +02:00
var g: WStatic = 5; // error
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'number' is not assignable to type 'WStatic'.
2014-07-13 01:04:16 +02:00
var h: W = 3;
var i: W = W.a;
i = W.a;
W.D;
var p: W.D;