mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
43 lines
1.6 KiB
Plaintext
43 lines
1.6 KiB
Plaintext
//// [tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/classWithoutExplicitConstructor.ts] ////
|
|
|
|
=== classWithoutExplicitConstructor.ts ===
|
|
class C {
|
|
>C : Symbol(C, Decl(classWithoutExplicitConstructor.ts, 0, 0))
|
|
|
|
x = 1
|
|
>x : Symbol(C.x, Decl(classWithoutExplicitConstructor.ts, 0, 9))
|
|
|
|
y = 'hello';
|
|
>y : Symbol(C.y, Decl(classWithoutExplicitConstructor.ts, 1, 9))
|
|
}
|
|
|
|
var c = new C();
|
|
>c : Symbol(c, Decl(classWithoutExplicitConstructor.ts, 5, 3))
|
|
>C : Symbol(C, Decl(classWithoutExplicitConstructor.ts, 0, 0))
|
|
|
|
var c2 = new C(null); // error
|
|
>c2 : Symbol(c2, Decl(classWithoutExplicitConstructor.ts, 6, 3))
|
|
>C : Symbol(C, Decl(classWithoutExplicitConstructor.ts, 0, 0))
|
|
|
|
class D<T extends Date> {
|
|
>D : Symbol(D, Decl(classWithoutExplicitConstructor.ts, 6, 21))
|
|
>T : Symbol(T, Decl(classWithoutExplicitConstructor.ts, 8, 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, --, --))
|
|
|
|
x = 2
|
|
>x : Symbol(D.x, Decl(classWithoutExplicitConstructor.ts, 8, 25))
|
|
|
|
y: T = null;
|
|
>y : Symbol(D.y, Decl(classWithoutExplicitConstructor.ts, 9, 9))
|
|
>T : Symbol(T, Decl(classWithoutExplicitConstructor.ts, 8, 8))
|
|
}
|
|
|
|
var d = new D();
|
|
>d : Symbol(d, Decl(classWithoutExplicitConstructor.ts, 13, 3))
|
|
>D : Symbol(D, Decl(classWithoutExplicitConstructor.ts, 6, 21))
|
|
|
|
var d2 = new D(null); // error
|
|
>d2 : Symbol(d2, Decl(classWithoutExplicitConstructor.ts, 14, 3))
|
|
>D : Symbol(D, Decl(classWithoutExplicitConstructor.ts, 6, 21))
|
|
|