23 lines
No EOL
696 B
Text
23 lines
No EOL
696 B
Text
==== tests/cases/compiler/newExpressionWithCast.ts (4 errors) ====
|
|
|
|
function Test() { }
|
|
// valid but error with noImplicitAny
|
|
var test = new Test();
|
|
~~~~~~~~~~
|
|
!!! 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.
|
|
|
|
function Test2() { }
|
|
// parse error
|
|
var test2 = new <any>Test2();
|
|
~
|
|
!!! Expression expected.
|
|
~~~~~~~~~~~~~~~~
|
|
!!! Operator '>' cannot be applied to types 'boolean' and 'void'.
|
|
~~~
|
|
!!! Cannot find name 'any'.
|
|
|
|
function Test3() { }
|
|
// valid with noImplicitAny
|
|
var test3 = new (<any>Test3)();
|
|
|
|
|