mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
37 lines
1.6 KiB
Plaintext
37 lines
1.6 KiB
Plaintext
callOverloads5.ts(1,10): error TS2814: Function with bodies can only merge with classes that are ambient.
|
|
callOverloads5.ts(2,10): error TS2391: Function implementation is missing or not immediately following the declaration.
|
|
callOverloads5.ts(2,10): error TS2814: Function with bodies can only merge with classes that are ambient.
|
|
callOverloads5.ts(3,7): error TS2813: Class declaration cannot implement overload list for 'Foo'.
|
|
|
|
|
|
==== callOverloads5.ts (4 errors) ====
|
|
function Foo():Foo; // error
|
|
~~~
|
|
!!! error TS2814: Function with bodies can only merge with classes that are ambient.
|
|
!!! related TS6506 callOverloads5.ts:3:7: Consider adding a 'declare' modifier to this class.
|
|
function Foo(s:string):Foo; // error
|
|
~~~
|
|
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
|
~~~
|
|
!!! error TS2814: Function with bodies can only merge with classes that are ambient.
|
|
!!! related TS6506 callOverloads5.ts:3:7: Consider adding a 'declare' modifier to this class.
|
|
class Foo { // error
|
|
~~~
|
|
!!! error TS2813: Class declaration cannot implement overload list for 'Foo'.
|
|
!!! related TS6506 callOverloads5.ts:3:7: Consider adding a 'declare' modifier to this class.
|
|
bar1(s:string);
|
|
bar1(n:number);
|
|
bar1(a:any) { /*WScript.Echo(a);*/ }
|
|
constructor(x: any) {
|
|
// WScript.Echo("Constructor function has executed");
|
|
}
|
|
}
|
|
//class Foo(s: String);
|
|
|
|
var f1 = new Foo("hey");
|
|
|
|
|
|
f1.bar1("a");
|
|
Foo();
|
|
Foo("s");
|
|
|