mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
27 lines
568 B
TypeScript
27 lines
568 B
TypeScript
//// [tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility5.ts] ////
|
|
|
|
//// [classConstructorAccessibility5.ts]
|
|
class Base {
|
|
protected constructor() { }
|
|
}
|
|
class Derived extends Base {
|
|
static make() { new Base() } // ok
|
|
}
|
|
|
|
class Unrelated {
|
|
static fake() { new Base() } // error
|
|
}
|
|
|
|
|
|
//// [classConstructorAccessibility5.js]
|
|
"use strict";
|
|
class Base {
|
|
constructor() { }
|
|
}
|
|
class Derived extends Base {
|
|
static make() { new Base(); } // ok
|
|
}
|
|
class Unrelated {
|
|
static fake() { new Base(); } // error
|
|
}
|