55 lines
No EOL
1.9 KiB
Text
55 lines
No EOL
1.9 KiB
Text
==== tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts (14 errors) ====
|
|
// it is an error to use a generic type without type arguments
|
|
// all of these are errors
|
|
|
|
declare class C<T> {
|
|
foo: T;
|
|
}
|
|
|
|
declare var c: C;
|
|
~
|
|
!!! Generic type 'C<T>' requires 1 type argument(s).
|
|
|
|
declare var a: { x: C };
|
|
~
|
|
!!! Generic type 'C<T>' requires 1 type argument(s).
|
|
declare var b: { (x: C): C };
|
|
~
|
|
!!! Generic type 'C<T>' requires 1 type argument(s).
|
|
~
|
|
!!! Generic type 'C<T>' requires 1 type argument(s).
|
|
declare var d: { [x: C]: C };
|
|
~
|
|
!!! An index signature parameter type must be 'string' or 'number'.
|
|
~
|
|
!!! Generic type 'C<T>' requires 1 type argument(s).
|
|
~
|
|
!!! Generic type 'C<T>' requires 1 type argument(s).
|
|
|
|
declare function f(x: C): C;
|
|
~
|
|
!!! Generic type 'C<T>' requires 1 type argument(s).
|
|
~
|
|
!!! Generic type 'C<T>' requires 1 type argument(s).
|
|
|
|
declare class D extends C {}
|
|
~
|
|
!!! Generic type 'C<T>' requires 1 type argument(s).
|
|
|
|
declare module M {
|
|
export class E<T> { foo: T }
|
|
}
|
|
|
|
declare class D2 extends M.C { }
|
|
~~~
|
|
!!! Module 'M' has no exported member 'C'.
|
|
declare class D3<T extends M.E> { }
|
|
~~~
|
|
!!! Generic type 'E<T>' requires 1 type argument(s).
|
|
|
|
declare function h<T extends C>(x: T);
|
|
~
|
|
!!! Generic type 'C<T>' requires 1 type argument(s).
|
|
declare function i<T extends M.E>(x: T);
|
|
~~~
|
|
!!! Generic type 'E<T>' requires 1 type argument(s). |