File: mutuallyRecursiveGenericBaseTypes1.types

package info (click to toggle)
node-typescript 2.1.5-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 203,960 kB
  • sloc: sh: 11; makefile: 5
file content (40 lines) | stat: -rw-r--r-- 670 bytes parent folder | download | duplicates (2)
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
=== tests/cases/compiler/mutuallyRecursiveGenericBaseTypes1.ts ===
interface A<T> {
>A : A<T>
>T : T

    foo(): B<T>; // instead of B does see this
>foo : { (): B<T>; (): void; }
>B : B<T>
>T : T

    foo(): void; // instead of B does see this
>foo : { (): B<T>; (): void; }
 
    foo2(): B<number>;
>foo2 : () => B<number>
>B : B<T>
}
 
interface B<T> extends A<T> {
>B : B<T>
>T : T
>A : A<T>
>T : T

    bar(): void;
>bar : () => void
}
 
var b: B<number>;
>b : B<number>
>B : B<T>

b.foo(); // should not error
>b.foo() : B<number>
>b.foo : { (): B<number>; (): void; }
>b : B<number>
>foo : { (): B<number>; (): void; }