forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.errors.txt
48 lines (42 loc) · 1.84 KB
/
staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.errors.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(12,1): error TS2322: Type 'C' is not assignable to type 'A'.
Property 'beep' is missing in type 'C'.
tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(13,1): error TS2322: Type 'typeof B' is not assignable to type 'A'.
Property 'beep' is missing in type 'typeof B'.
tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(16,5): error TS2322: Type 'C' is not assignable to type 'B'.
Property 'beep' is missing in type 'C'.
tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(17,1): error TS2322: Type 'typeof B' is not assignable to type 'B'.
Property 'beep' is missing in type 'typeof B'.
==== tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts (4 errors) ====
interface A {
beep();
}
class B {
public beep() { }
}
class C {
public static beep() { }
}
var a: A = new B();
a = new C(); // error beep is missing
~
!!! error TS2322: Type 'C' is not assignable to type 'A'.
!!! error TS2322: Property 'beep' is missing in type 'C'.
a = B; // error beep is missing
~
!!! error TS2322: Type 'typeof B' is not assignable to type 'A'.
!!! error TS2322: Property 'beep' is missing in type 'typeof B'.
a = C;
var b: B = new C(); // error name is missing
~
!!! error TS2322: Type 'C' is not assignable to type 'B'.
!!! error TS2322: Property 'beep' is missing in type 'C'.
b = B; // error beep is missing
~
!!! error TS2322: Type 'typeof B' is not assignable to type 'B'.
!!! error TS2322: Property 'beep' is missing in type 'typeof B'.
b = C;
b = a;
var c: C = new B();
c = B;
c = C;
c = a;