48 lines
No EOL
1.2 KiB
Text
48 lines
No EOL
1.2 KiB
Text
==== tests/cases/conformance/interfaces/declarationMerging/twoGenericInterfacesWithDifferentConstraints.ts (3 errors) ====
|
|
interface A<T extends Date> {
|
|
x: T;
|
|
}
|
|
|
|
interface A<T extends Number> { // error
|
|
~
|
|
!!! All declarations of an interface must have identical type parameters.
|
|
y: T;
|
|
}
|
|
|
|
module M {
|
|
interface B<T extends A<Date>> {
|
|
x: T;
|
|
}
|
|
|
|
interface B<T extends A<any>> { // error
|
|
~
|
|
!!! All declarations of an interface must have identical type parameters.
|
|
y: T;
|
|
}
|
|
}
|
|
|
|
module M2 {
|
|
interface A<T extends Date> {
|
|
x: T;
|
|
}
|
|
}
|
|
|
|
module M2 {
|
|
interface A<T extends Number> { // ok, different declaration space from other M2.A
|
|
y: T;
|
|
}
|
|
}
|
|
|
|
module M3 {
|
|
export interface A<T extends Date> {
|
|
x: T;
|
|
}
|
|
}
|
|
|
|
module M3 {
|
|
export interface A<T extends Number> { // error
|
|
~
|
|
!!! All declarations of an interface must have identical type parameters.
|
|
y: T;
|
|
}
|
|
} |