File: inheritanceOfGenericConstructorMethod1.symbols

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 (32 lines) | stat: -rw-r--r-- 1,951 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
29
30
31
32
=== tests/cases/compiler/inheritanceOfGenericConstructorMethod1.ts ===
class A<T> { }
>A : Symbol(A, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 0))
>T : Symbol(T, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 8))

class B<T> extends A<T> {}
>B : Symbol(B, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 14))
>T : Symbol(T, Decl(inheritanceOfGenericConstructorMethod1.ts, 1, 8))
>A : Symbol(A, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 0))
>T : Symbol(T, Decl(inheritanceOfGenericConstructorMethod1.ts, 1, 8))

var a = new A<Date>();
>a : Symbol(a, Decl(inheritanceOfGenericConstructorMethod1.ts, 2, 3))
>A : Symbol(A, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 0))
>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --))

var b1 = new B(); // no error
>b1 : Symbol(b1, Decl(inheritanceOfGenericConstructorMethod1.ts, 3, 3))
>B : Symbol(B, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 14))

var b2: B<Date> = new B<Date>(); // no error
>b2 : Symbol(b2, Decl(inheritanceOfGenericConstructorMethod1.ts, 4, 3))
>B : Symbol(B, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 14))
>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --))
>B : Symbol(B, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 14))
>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --))

var b3 = new B<Date>(); // error, could not select overload for 'new' expression
>b3 : Symbol(b3, Decl(inheritanceOfGenericConstructorMethod1.ts, 5, 3))
>B : Symbol(B, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 14))
>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --))