mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
42 lines
750 B
TypeScript
42 lines
750 B
TypeScript
//// [tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues.ts] ////
|
|
|
|
//// [constructorImplementationWithDefaultValues.ts]
|
|
class C {
|
|
constructor(x);
|
|
constructor(x = 1) {
|
|
var y = x;
|
|
}
|
|
}
|
|
|
|
class D<T> {
|
|
constructor(x);
|
|
constructor(x:T = null) {
|
|
var y = x;
|
|
}
|
|
}
|
|
|
|
class E<T extends Date> {
|
|
constructor(x);
|
|
constructor(x: T = null) {
|
|
var y = x;
|
|
}
|
|
}
|
|
|
|
//// [constructorImplementationWithDefaultValues.js]
|
|
"use strict";
|
|
class C {
|
|
constructor(x = 1) {
|
|
var y = x;
|
|
}
|
|
}
|
|
class D {
|
|
constructor(x = null) {
|
|
var y = x;
|
|
}
|
|
}
|
|
class E {
|
|
constructor(x = null) {
|
|
var y = x;
|
|
}
|
|
}
|