TypeScript/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.errors.txt
2014-09-11 16:11:08 -07:00

38 lines
1.1 KiB
Plaintext

==== tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts (4 errors) ====
interface A {
name();
}
class B {
public name() { }
}
class C {
public static name() { }
}
var a: A = new B();
a = new C(); // error name is missing
~
!!! error TS2322: Type 'C' is not assignable to type 'A':
!!! error TS2322: Property 'name' is missing in type 'C'.
a = B; // error name is missing
~
!!! error TS2322: Type 'typeof B' is not assignable to type 'A':
!!! error TS2322: Property 'name' 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 'name' is missing in type 'C'.
b = B; // error name is missing
~
!!! error TS2322: Type 'typeof B' is not assignable to type 'B':
!!! error TS2322: Property 'name' is missing in type 'typeof B'.
b = C;
b = a;
var c: C = new B();
c = B;
c = C;
c = a;