2014-12-17 00:56:56 +01:00
|
|
|
tests/cases/compiler/typeParameterConstraints1.ts(6,25): error TS2304: Cannot find name 'hm'.
|
2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/compiler/typeParameterConstraints1.ts(8,25): error TS1110: Type expected.
|
|
|
|
tests/cases/compiler/typeParameterConstraints1.ts(9,25): error TS1110: Type expected.
|
|
|
|
tests/cases/compiler/typeParameterConstraints1.ts(10,26): error TS1110: Type expected.
|
|
|
|
tests/cases/compiler/typeParameterConstraints1.ts(11,26): error TS1110: Type expected.
|
|
|
|
tests/cases/compiler/typeParameterConstraints1.ts(12,26): error TS2304: Cannot find name 'undefined'.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/typeParameterConstraints1.ts (6 errors) ====
|
|
|
|
function foo1<T extends any>(test: T) { }
|
|
|
|
function foo2<T extends number>(test: T) { }
|
|
|
|
function foo3<T extends string>(test: T) { }
|
|
|
|
function foo4<T extends Date>(test: T) { } // valid
|
|
|
|
function foo5<T extends RegExp>(test: T) { } // valid
|
|
|
|
function foo6<T extends hm>(test: T) { }
|
|
|
|
~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2304: Cannot find name 'hm'.
|
2014-07-13 01:04:16 +02:00
|
|
|
function foo7<T extends Object>(test: T) { } // valid
|
|
|
|
function foo8<T extends "">(test: T) { }
|
|
|
|
~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1110: Type expected.
|
2014-07-13 01:04:16 +02:00
|
|
|
function foo9<T extends 1 > (test: T) { }
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1110: Type expected.
|
2014-07-13 01:04:16 +02:00
|
|
|
function foo10<T extends (1)> (test: T) { }
|
2014-11-20 01:55:18 +01:00
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1110: Type expected.
|
2014-07-13 01:04:16 +02:00
|
|
|
function foo11<T extends null> (test: T) { }
|
|
|
|
~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1110: Type expected.
|
2014-07-13 01:04:16 +02:00
|
|
|
function foo12<T extends undefined>(test: T) { }
|
|
|
|
~~~~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2304: Cannot find name 'undefined'.
|
2014-07-13 01:04:16 +02:00
|
|
|
function foo13<T extends void>(test: T) { }
|