File: derivedClassWithPrivateStaticShadowingProtectedStatic.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (28 lines) | stat: -rw-r--r-- 1,199 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingProtectedStatic.ts(12,7): error TS2417: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base'.
  Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'.


==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingProtectedStatic.ts (1 errors) ====
    class Base {
        protected static x: string;
        protected static fn(): string {
            return '';
        }
    
        protected static get a() { return 1; }
        protected static set a(v) { }
    }
    
    // should be error
    class Derived extends Base {
          ~~~~~~~
!!! error TS2417: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base'.
!!! error TS2417:   Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'.
        private static x: string; 
        private static fn(): string {
            return '';
        }
    
        private static get a() { return 1; }
        private static set a(v) { }
    }