68 lines
No EOL
2.5 KiB
Text
68 lines
No EOL
2.5 KiB
Text
==== tests/cases/compiler/interfaceWithMultipleDeclarations.ts (15 errors) ====
|
|
interface I1<V> {
|
|
}
|
|
interface I1<S> { // Name mismatch
|
|
~~
|
|
!!! All declarations of an interface must have identical type parameters.
|
|
}
|
|
interface I1<T, U extends T> { // Length mismatch
|
|
~~
|
|
!!! All declarations of an interface must have identical type parameters.
|
|
~~~~~~~~~~~
|
|
!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
}
|
|
interface I1<V extends string> { // constraint present
|
|
~~
|
|
!!! All declarations of an interface must have identical type parameters.
|
|
}
|
|
interface I1<V, X extends V> { // Length mismatch
|
|
~~
|
|
!!! All declarations of an interface must have identical type parameters.
|
|
~~~~~~~~~~~
|
|
!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
}
|
|
interface I1 { // Length mismatch
|
|
~~
|
|
!!! All declarations of an interface must have identical type parameters.
|
|
}
|
|
|
|
interface I2<T extends string> {
|
|
}
|
|
interface I2<T extends () => string> { // constraint mismatch
|
|
~~
|
|
!!! All declarations of an interface must have identical type parameters.
|
|
}
|
|
interface I2<T> { // constraint absent
|
|
~~
|
|
!!! All declarations of an interface must have identical type parameters.
|
|
}
|
|
interface I2<U> { // name mismatch
|
|
~~
|
|
!!! All declarations of an interface must have identical type parameters.
|
|
}
|
|
interface I2<X, Y> { // length mismatch
|
|
~~
|
|
!!! All declarations of an interface must have identical type parameters.
|
|
}
|
|
interface I2 { // length mismatch
|
|
~~
|
|
!!! All declarations of an interface must have identical type parameters.
|
|
}
|
|
|
|
interface I3 {
|
|
}
|
|
interface I3<T> { // length mismatch
|
|
~~
|
|
!!! All declarations of an interface must have identical type parameters.
|
|
}
|
|
|
|
class Foo<T> {
|
|
}
|
|
interface I4<T extends Foo<T>> {
|
|
~~~~~~~~~~~~~~~~
|
|
!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
}
|
|
interface I4<T extends Foo<T>> { // Should not be error
|
|
~~~~~~~~~~~~~~~~
|
|
!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
} |