File: mergedInterfacesWithMultipleBases4.errors.txt

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (42 lines) | stat: -rw-r--r-- 1,232 bytes parent folder | download | duplicates (7)
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/interfaces/declarationMerging/mergedInterfacesWithMultipleBases4.ts(19,11): error TS2320: Interface 'A<T>' cannot simultaneously extend types 'C<string>' and 'C<number>'.
  Named property 'a' of types 'C<string>' and 'C<number>' are not identical.


==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases4.ts (1 errors) ====
    // merged interfaces behave as if all extends clauses from each declaration are merged together
    
    class C<T> {
        a: T;
    }
    
    class C2<T> {
        b: T;
    }
    
    class C3<T> {
        c: T;
    }
    
    class C4<T> {
        d: T;
    }
    
    interface A<T> extends C<string>, C3<string> { // error
              ~
!!! error TS2320: Interface 'A<T>' cannot simultaneously extend types 'C<string>' and 'C<number>'.
!!! error TS2320:   Named property 'a' of types 'C<string>' and 'C<number>' are not identical.
        y: T;
    }
    
    interface A<T> extends C<number>, C4<string> {
        z: T;
    }
    
    class D implements A<boolean> {
        a: string;
        b: string;
        c: string;
        d: string;
        y: boolean;
        z: boolean;
    }