mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
62 lines
1.1 KiB
TypeScript
62 lines
1.1 KiB
TypeScript
//// [tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts] ////
|
|
|
|
//// [constructSignatureWithAccessibilityModifiersOnParameters2.ts]
|
|
// Parameter properties are not valid in overloads of constructors
|
|
|
|
class C {
|
|
constructor(public x, private y);
|
|
constructor(public x, private y) { }
|
|
}
|
|
|
|
class C2 {
|
|
constructor(private x);
|
|
constructor(public x) { }
|
|
}
|
|
|
|
class C3 {
|
|
constructor(private x);
|
|
constructor(private y) { }
|
|
}
|
|
|
|
interface I {
|
|
new (public x);
|
|
new (public x);
|
|
}
|
|
|
|
interface I2 {
|
|
new (private x);
|
|
new (private x);
|
|
}
|
|
|
|
var a: {
|
|
new (public x);
|
|
new (public y);
|
|
}
|
|
|
|
var b: {
|
|
new (private x);
|
|
new (private y);
|
|
}
|
|
|
|
//// [constructSignatureWithAccessibilityModifiersOnParameters2.js]
|
|
"use strict";
|
|
// Parameter properties are not valid in overloads of constructors
|
|
class C {
|
|
constructor(x, y) {
|
|
this.x = x;
|
|
this.y = y;
|
|
}
|
|
}
|
|
class C2 {
|
|
constructor(x) {
|
|
this.x = x;
|
|
}
|
|
}
|
|
class C3 {
|
|
constructor(y) {
|
|
this.y = y;
|
|
}
|
|
}
|
|
var a;
|
|
var b;
|