File: genericSpecializations1.symbols

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,830 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/compiler/genericSpecializations1.ts ===
interface IFoo<T> {
>IFoo : Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0))
>T : Symbol(T, Decl(genericSpecializations1.ts, 0, 15))

    foo<T>(x: T): T; // no error on implementors because IFoo's T is different from foo's T
>foo : Symbol(IFoo.foo, Decl(genericSpecializations1.ts, 0, 19))
>T : Symbol(T, Decl(genericSpecializations1.ts, 1, 8))
>x : Symbol(x, Decl(genericSpecializations1.ts, 1, 11))
>T : Symbol(T, Decl(genericSpecializations1.ts, 1, 8))
>T : Symbol(T, Decl(genericSpecializations1.ts, 1, 8))
}

class IntFooBad implements IFoo<number> {
>IntFooBad : Symbol(IntFooBad, Decl(genericSpecializations1.ts, 2, 1))
>IFoo : Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0))

    foo(x: string): string { return null; }
>foo : Symbol(IntFooBad.foo, Decl(genericSpecializations1.ts, 4, 41))
>x : Symbol(x, Decl(genericSpecializations1.ts, 5, 8))
}

class StringFoo2 implements IFoo<string> {
>StringFoo2 : Symbol(StringFoo2, Decl(genericSpecializations1.ts, 6, 1))
>IFoo : Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0))

    foo(x: string): string { return null; }
>foo : Symbol(StringFoo2.foo, Decl(genericSpecializations1.ts, 8, 42))
>x : Symbol(x, Decl(genericSpecializations1.ts, 9, 8))
}

class StringFoo3 implements IFoo<string> {
>StringFoo3 : Symbol(StringFoo3, Decl(genericSpecializations1.ts, 10, 1))
>IFoo : Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0))

    foo<T>(x: T): T { return null; }
>foo : Symbol(StringFoo3.foo, Decl(genericSpecializations1.ts, 12, 42))
>T : Symbol(T, Decl(genericSpecializations1.ts, 13, 8))
>x : Symbol(x, Decl(genericSpecializations1.ts, 13, 11))
>T : Symbol(T, Decl(genericSpecializations1.ts, 13, 8))
>T : Symbol(T, Decl(genericSpecializations1.ts, 13, 8))
}