2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/compiler/typeParameterExplicitlyExtendsAny.ts(3,7): error TS2339: Property 'blah' does not exist on type 'T'.
|
|
|
|
tests/cases/compiler/typeParameterExplicitlyExtendsAny.ts(9,7): error TS2339: Property 'blah' does not exist on type 'T'.
|
|
|
|
tests/cases/compiler/typeParameterExplicitlyExtendsAny.ts(10,7): error TS2339: Property 'toString' does not exist on type 'T'.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/typeParameterExplicitlyExtendsAny.ts (3 errors) ====
|
|
|
|
function fee<T>() {
|
|
|
|
var t: T;
|
|
|
|
t.blah; // Error
|
|
|
|
~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2339: Property 'blah' does not exist on type 'T'.
|
2014-07-13 01:04:16 +02:00
|
|
|
t.toString; // ok
|
|
|
|
}
|
|
|
|
|
|
|
|
function fee2<T extends any>() {
|
|
|
|
var t: T;
|
|
|
|
t.blah; // Error
|
|
|
|
~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2339: Property 'blah' does not exist on type 'T'.
|
2014-07-13 01:04:16 +02:00
|
|
|
t.toString; // ok
|
|
|
|
~~~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2339: Property 'toString' does not exist on type 'T'.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|