19 lines
701 B
Text
19 lines
701 B
Text
|
==== tests/cases/conformance/types/any/anyAsGenericFunctionCall.ts (4 errors) ====
|
||
|
// any is considered an untyped function call
|
||
|
// can be called except with type arguments which is an error
|
||
|
|
||
|
var x: any;
|
||
|
var a = x<number>();
|
||
|
~~~~~~~~~~~
|
||
|
!!! Untyped function calls may not accept type arguments.
|
||
|
var b = x<string>('hello');
|
||
|
~~~~~~~~~~~~~~~~~~
|
||
|
!!! Untyped function calls may not accept type arguments.
|
||
|
|
||
|
class C { foo: string; }
|
||
|
var c = x<C>(x);
|
||
|
~~~~~~~
|
||
|
!!! Untyped function calls may not accept type arguments.
|
||
|
var d = x<any>(x);
|
||
|
~~~~~~~~~
|
||
|
!!! Untyped function calls may not accept type arguments.
|