29 lines
No EOL
795 B
Text
29 lines
No EOL
795 B
Text
==== tests/cases/compiler/callOverloads4.ts (5 errors) ====
|
|
|
|
function Foo():Foo;
|
|
~~~
|
|
!!! Cannot find name 'Foo'.
|
|
function Foo(s:string):Foo;
|
|
~~~
|
|
!!! Function implementation is missing or not immediately following the declaration.
|
|
~~~
|
|
!!! Cannot find name 'Foo'.
|
|
class Foo {
|
|
~~~
|
|
!!! Duplicate identifier 'Foo'.
|
|
bar1() { /*WScript.Echo("bar1");*/ }
|
|
constructor(s: string);
|
|
constructor(x: any) {
|
|
// WScript.Echo("Constructor function has executed");
|
|
}
|
|
}
|
|
|
|
var f1 = new Foo("hey");
|
|
~~~~~~~~~~~~~~
|
|
!!! Only a void function can be called with the 'new' keyword.
|
|
|
|
|
|
f1.bar1();
|
|
Foo();
|
|
Foo("s");
|
|
|