mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
17 lines
587 B
Plaintext
17 lines
587 B
Plaintext
classConstructorAccessibility5.ts(9,21): error TS2674: Constructor of class 'Base' is protected and only accessible within the class declaration.
|
|
|
|
|
|
==== classConstructorAccessibility5.ts (1 errors) ====
|
|
class Base {
|
|
protected constructor() { }
|
|
}
|
|
class Derived extends Base {
|
|
static make() { new Base() } // ok
|
|
}
|
|
|
|
class Unrelated {
|
|
static fake() { new Base() } // error
|
|
~~~~~~~~~~
|
|
!!! error TS2674: Constructor of class 'Base' is protected and only accessible within the class declaration.
|
|
}
|
|
|