File: override8.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (42 lines) | stat: -rw-r--r-- 1,588 bytes parent folder | download | duplicates (3)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
tests/cases/conformance/override/override8.ts(6,17): error TS4115: This parameter property must have an 'override' modifier because it overrides a member in base class 'B'.
tests/cases/conformance/override/override8.ts(18,17): error TS4115: This parameter property must have an 'override' modifier because it overrides a member in base class 'BB'.
tests/cases/conformance/override/override8.ts(24,12): error TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'BB'.


==== tests/cases/conformance/override/override8.ts (3 errors) ====
    class B {
        a: string
    }
    
    class D extends B {
        constructor(public a: string, public b: string) {
                    ~~~~~~~~~~~~~~~~
!!! error TS4115: This parameter property must have an 'override' modifier because it overrides a member in base class 'B'.
            super();
        }
    }
    
    class BB {
        constructor(public a: string) {
    
        }
    }
    
    class DD extends BB {
        constructor(public a: string) {
                    ~~~~~~~~~~~~~~~~
!!! error TS4115: This parameter property must have an 'override' modifier because it overrides a member in base class 'BB'.
            super(a)
        }
    }
    
    class DDD extends BB {
        public a: string;
               ~
!!! error TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'BB'.
    
        constructor(a: string) {
            super(a)
            this.a = a
        }
    }