2014-07-13 01:04:16 +02:00
|
|
|
//// [staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts]
|
|
|
|
interface A {
|
|
|
|
name();
|
|
|
|
}
|
|
|
|
class B {
|
|
|
|
public name() { }
|
|
|
|
}
|
|
|
|
class C {
|
|
|
|
public static name() { }
|
|
|
|
}
|
|
|
|
|
|
|
|
var a: A = new B();
|
|
|
|
a = new C(); // error name is missing
|
|
|
|
a = B; // error name is missing
|
|
|
|
a = C;
|
|
|
|
|
|
|
|
var b: B = new C(); // error name is missing
|
|
|
|
b = B; // error name is missing
|
|
|
|
b = C;
|
|
|
|
b = a;
|
|
|
|
|
|
|
|
var c: C = new B();
|
|
|
|
c = B;
|
|
|
|
c = C;
|
|
|
|
c = a;
|
|
|
|
|
|
|
|
|
|
|
|
//// [staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.js]
|
|
|
|
var B = (function () {
|
|
|
|
function B() {
|
|
|
|
}
|
|
|
|
B.prototype.name = function () {
|
|
|
|
};
|
|
|
|
return B;
|
|
|
|
})();
|
|
|
|
var C = (function () {
|
|
|
|
function C() {
|
|
|
|
}
|
|
|
|
C.name = function () {
|
|
|
|
};
|
|
|
|
return C;
|
|
|
|
})();
|
|
|
|
var a = new B();
|
2014-08-16 00:49:09 +02:00
|
|
|
a = new C(); // error name is missing
|
|
|
|
a = B; // error name is missing
|
2014-07-13 01:04:16 +02:00
|
|
|
a = C;
|
2014-08-15 22:18:54 +02:00
|
|
|
var b = new C(); // error name is missing
|
2014-08-16 00:49:09 +02:00
|
|
|
b = B; // error name is missing
|
2014-07-13 01:04:16 +02:00
|
|
|
b = C;
|
|
|
|
b = a;
|
|
|
|
var c = new B();
|
|
|
|
c = B;
|
|
|
|
c = C;
|
|
|
|
c = a;
|