38 lines
No EOL
928 B
Text
38 lines
No EOL
928 B
Text
==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases4.ts (1 errors) ====
|
|
// merged interfaces behave as if all extends clauses from each declaration are merged together
|
|
|
|
class C<T> {
|
|
a: T;
|
|
}
|
|
|
|
class C2<T> {
|
|
b: T;
|
|
}
|
|
|
|
class C3<T> {
|
|
c: T;
|
|
}
|
|
|
|
class C4<T> {
|
|
d: T;
|
|
}
|
|
|
|
interface A<T> extends C<string>, C3<string> { // error
|
|
~
|
|
!!! Interface 'A<T>' cannot simultaneously extend types 'C<string>' and 'C<number>':
|
|
!!! Named properties 'a' of types 'C<string>' and 'C<number>' are not identical.
|
|
y: T;
|
|
}
|
|
|
|
interface A<T> extends C<number>, C4<string> {
|
|
z: T;
|
|
}
|
|
|
|
class D implements A<boolean> {
|
|
a: string;
|
|
b: string;
|
|
c: string;
|
|
d: string;
|
|
y: boolean;
|
|
z: boolean;
|
|
} |