1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
|
=== tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor2.ts ===
class Base {
>Base : Symbol(Base, Decl(derivedClassWithoutExplicitConstructor2.ts, 0, 0))
a = 1;
>a : Symbol(Base.a, Decl(derivedClassWithoutExplicitConstructor2.ts, 0, 12))
constructor(x: number, y?: number, z?: number);
>x : Symbol(x, Decl(derivedClassWithoutExplicitConstructor2.ts, 2, 16))
>y : Symbol(y, Decl(derivedClassWithoutExplicitConstructor2.ts, 2, 26))
>z : Symbol(z, Decl(derivedClassWithoutExplicitConstructor2.ts, 2, 38))
constructor(x: number, y?: number);
>x : Symbol(x, Decl(derivedClassWithoutExplicitConstructor2.ts, 3, 16))
>y : Symbol(y, Decl(derivedClassWithoutExplicitConstructor2.ts, 3, 26))
constructor(x: number) { this.a = x; }
>x : Symbol(x, Decl(derivedClassWithoutExplicitConstructor2.ts, 4, 16))
>this.a : Symbol(Base.a, Decl(derivedClassWithoutExplicitConstructor2.ts, 0, 12))
>this : Symbol(Base, Decl(derivedClassWithoutExplicitConstructor2.ts, 0, 0))
>a : Symbol(Base.a, Decl(derivedClassWithoutExplicitConstructor2.ts, 0, 12))
>x : Symbol(x, Decl(derivedClassWithoutExplicitConstructor2.ts, 4, 16))
}
class Derived extends Base {
>Derived : Symbol(Derived, Decl(derivedClassWithoutExplicitConstructor2.ts, 5, 1))
>Base : Symbol(Base, Decl(derivedClassWithoutExplicitConstructor2.ts, 0, 0))
x = 1
>x : Symbol(Derived.x, Decl(derivedClassWithoutExplicitConstructor2.ts, 7, 28))
y = 'hello';
>y : Symbol(Derived.y, Decl(derivedClassWithoutExplicitConstructor2.ts, 8, 9))
}
var r = new Derived(); // error
>r : Symbol(r, Decl(derivedClassWithoutExplicitConstructor2.ts, 12, 3))
>Derived : Symbol(Derived, Decl(derivedClassWithoutExplicitConstructor2.ts, 5, 1))
var r2 = new Derived(1);
>r2 : Symbol(r2, Decl(derivedClassWithoutExplicitConstructor2.ts, 13, 3))
>Derived : Symbol(Derived, Decl(derivedClassWithoutExplicitConstructor2.ts, 5, 1))
var r3 = new Derived(1, 2);
>r3 : Symbol(r3, Decl(derivedClassWithoutExplicitConstructor2.ts, 14, 3))
>Derived : Symbol(Derived, Decl(derivedClassWithoutExplicitConstructor2.ts, 5, 1))
var r4 = new Derived(1, 2, 3);
>r4 : Symbol(r4, Decl(derivedClassWithoutExplicitConstructor2.ts, 15, 3))
>Derived : Symbol(Derived, Decl(derivedClassWithoutExplicitConstructor2.ts, 5, 1))
class Base2<T> {
>Base2 : Symbol(Base2, Decl(derivedClassWithoutExplicitConstructor2.ts, 15, 30))
>T : Symbol(T, Decl(derivedClassWithoutExplicitConstructor2.ts, 17, 12))
a: T;
>a : Symbol(Base2.a, Decl(derivedClassWithoutExplicitConstructor2.ts, 17, 16))
>T : Symbol(T, Decl(derivedClassWithoutExplicitConstructor2.ts, 17, 12))
constructor(x: T, y?: T, z?: T);
>x : Symbol(x, Decl(derivedClassWithoutExplicitConstructor2.ts, 19, 16))
>T : Symbol(T, Decl(derivedClassWithoutExplicitConstructor2.ts, 17, 12))
>y : Symbol(y, Decl(derivedClassWithoutExplicitConstructor2.ts, 19, 21))
>T : Symbol(T, Decl(derivedClassWithoutExplicitConstructor2.ts, 17, 12))
>z : Symbol(z, Decl(derivedClassWithoutExplicitConstructor2.ts, 19, 28))
>T : Symbol(T, Decl(derivedClassWithoutExplicitConstructor2.ts, 17, 12))
constructor(x: T, y?: T);
>x : Symbol(x, Decl(derivedClassWithoutExplicitConstructor2.ts, 20, 16))
>T : Symbol(T, Decl(derivedClassWithoutExplicitConstructor2.ts, 17, 12))
>y : Symbol(y, Decl(derivedClassWithoutExplicitConstructor2.ts, 20, 21))
>T : Symbol(T, Decl(derivedClassWithoutExplicitConstructor2.ts, 17, 12))
constructor(x: T) { this.a = x; }
>x : Symbol(x, Decl(derivedClassWithoutExplicitConstructor2.ts, 21, 16))
>T : Symbol(T, Decl(derivedClassWithoutExplicitConstructor2.ts, 17, 12))
>this.a : Symbol(Base2.a, Decl(derivedClassWithoutExplicitConstructor2.ts, 17, 16))
>this : Symbol(Base2, Decl(derivedClassWithoutExplicitConstructor2.ts, 15, 30))
>a : Symbol(Base2.a, Decl(derivedClassWithoutExplicitConstructor2.ts, 17, 16))
>x : Symbol(x, Decl(derivedClassWithoutExplicitConstructor2.ts, 21, 16))
}
class D<T extends Date> extends Base2<T> {
>D : Symbol(D, Decl(derivedClassWithoutExplicitConstructor2.ts, 22, 1))
>T : Symbol(T, Decl(derivedClassWithoutExplicitConstructor2.ts, 24, 8))
>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --))
>Base2 : Symbol(Base2, Decl(derivedClassWithoutExplicitConstructor2.ts, 15, 30))
>T : Symbol(T, Decl(derivedClassWithoutExplicitConstructor2.ts, 24, 8))
x = 2
>x : Symbol(D.x, Decl(derivedClassWithoutExplicitConstructor2.ts, 24, 42))
y: T = null;
>y : Symbol(D.y, Decl(derivedClassWithoutExplicitConstructor2.ts, 25, 9))
>T : Symbol(T, Decl(derivedClassWithoutExplicitConstructor2.ts, 24, 8))
}
var d = new D(); // error
>d : Symbol(d, Decl(derivedClassWithoutExplicitConstructor2.ts, 29, 3))
>D : Symbol(D, Decl(derivedClassWithoutExplicitConstructor2.ts, 22, 1))
var d2 = new D(new Date()); // ok
>d2 : Symbol(d2, Decl(derivedClassWithoutExplicitConstructor2.ts, 30, 3))
>D : Symbol(D, Decl(derivedClassWithoutExplicitConstructor2.ts, 22, 1))
>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --))
var d3 = new D(new Date(), new Date());
>d3 : Symbol(d3, Decl(derivedClassWithoutExplicitConstructor2.ts, 31, 3))
>D : Symbol(D, Decl(derivedClassWithoutExplicitConstructor2.ts, 22, 1))
>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --))
>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --))
var d4 = new D(new Date(), new Date(), new Date());
>d4 : Symbol(d4, Decl(derivedClassWithoutExplicitConstructor2.ts, 32, 3))
>D : Symbol(D, Decl(derivedClassWithoutExplicitConstructor2.ts, 22, 1))
>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --))
>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --))
>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --))
|