20 lines
604 B
Plaintext
20 lines
604 B
Plaintext
==== tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts (4 errors) ====
|
|
class C<T> {
|
|
foo(): T { return null }
|
|
}
|
|
interface I<T> {
|
|
bar(): T;
|
|
}
|
|
var c1: C; // error
|
|
~
|
|
!!! Generic type 'C<T>' requires 1 type argument(s).
|
|
var i1: I; // error
|
|
~
|
|
!!! Generic type 'I<T>' requires 1 type argument(s).
|
|
var c2: C<I>; // should be an error
|
|
~
|
|
!!! Generic type 'I<T>' requires 1 type argument(s).
|
|
var i2: I<C>; // should be an error
|
|
~
|
|
!!! Generic type 'C<T>' requires 1 type argument(s).
|
|
|