TypeScript/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.errors.txt
2014-09-12 13:35:07 -07:00

61 lines
2.4 KiB
Plaintext

tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts(21,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts(22,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts(44,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts(45,10): error TS2346: Supplied parameters do not match any signature of call target.
==== tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts (4 errors) ====
// automatic constructors with a class hieararchy of depth > 2
class Base {
a = 1;
constructor(x: number) { this.a = x; }
}
class Derived extends Base {
b = '';
constructor(y: string, z: string) {
super(2);
this.b = y;
}
}
class Derived2 extends Derived {
x = 1
y = 'hello';
}
var r = new Derived(); // error
~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
var r2 = new Derived2(1); // error
~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
var r3 = new Derived('', '');
class Base2<T> {
a: T;
constructor(x: T) { this.a = x; }
}
class D<T> extends Base {
b: T = null;
constructor(y: T, z: T) {
super(2);
this.b = y;
}
}
class D2<T extends Date> extends D<T> {
x = 2
y: T = null;
}
var d = new D2(); // error
~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
var d2 = new D2(new Date()); // error
~~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
var d3 = new D2(new Date(), new Date()); // ok