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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
//// [mergedInterfacesWithMultipleBases.ts]
// merged interfaces behave as if all extends clauses from each declaration are merged together
// no errors expected
class C {
a: number;
}
class C2 {
b: number;
}
interface A extends C {
y: string;
}
interface A extends C2 {
z: string;
}
class D implements A {
a: number;
b: number;
y: string;
z: string;
}
var a: A;
var r = a.a;
// generic interfaces in a module
module M {
class C<T> {
a: T;
}
class C2<T> {
b: T;
}
interface A<T> extends C<T> {
y: T;
}
interface A<T> extends C2<string> {
z: T;
}
class D implements A<boolean> {
a: boolean;
b: string;
y: boolean;
z: boolean;
}
}
//// [mergedInterfacesWithMultipleBases.js]
// merged interfaces behave as if all extends clauses from each declaration are merged together
// no errors expected
var C = /** @class */ (function () {
function C() {
}
return C;
}());
var C2 = /** @class */ (function () {
function C2() {
}
return C2;
}());
var D = /** @class */ (function () {
function D() {
}
return D;
}());
var a;
var r = a.a;
// generic interfaces in a module
var M;
(function (M) {
var C = /** @class */ (function () {
function C() {
}
return C;
}());
var C2 = /** @class */ (function () {
function C2() {
}
return C2;
}());
var D = /** @class */ (function () {
function D() {
}
return D;
}());
})(M || (M = {}));
|