30 lines
No EOL
817 B
Text
30 lines
No EOL
817 B
Text
==== tests/cases/compiler/constructorOverloads1.ts (3 errors) ====
|
|
class Foo {
|
|
constructor(s: string);
|
|
constructor(n: number);
|
|
constructor(x: any) {
|
|
|
|
}
|
|
constructor(x: any) {
|
|
~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
}
|
|
~~~~~
|
|
!!! Multiple constructor implementations are not allowed.
|
|
bar1() { /*WScript.Echo("bar1");*/ }
|
|
bar2() { /*WScript.Echo("bar1");*/ }
|
|
}
|
|
|
|
var f1 = new Foo("hey");
|
|
var f2 = new Foo(0);
|
|
var f3 = new Foo(f1);
|
|
~~~~~~~~~~~
|
|
!!! Supplied parameters do not match any signature of call target.
|
|
var f4 = new Foo([f1,f2,f3]);
|
|
~~~~~~~~~~~~~~~~~~~
|
|
!!! Supplied parameters do not match any signature of call target.
|
|
|
|
f1.bar1();
|
|
f1.bar2();
|
|
|