mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
122 lines
6.6 KiB
Plaintext
122 lines
6.6 KiB
Plaintext
//// [tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor2.ts] ////
|
|
|
|
=== 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, --, --), Decl(lib.es2015.symbol.wellknown.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, --, --), Decl(lib.es2015.symbol.wellknown.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, --, --), Decl(lib.es2015.symbol.wellknown.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, --, --), Decl(lib.es2015.symbol.wellknown.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, --, --), Decl(lib.es2015.symbol.wellknown.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, --, --), Decl(lib.es2015.symbol.wellknown.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, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
|
|