File: genericTypeReferenceWithoutTypeArgument2.types

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 (89 lines) | stat: -rw-r--r-- 1,472 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
=== tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts ===
// it is an error to use a generic type without type arguments
// all of these are errors 

interface I<T> {
    foo: T;
>foo : T
}

var c: I;
>c : any

var a: { x: I };
>a : { x: any; }
>x : any

var b: { (x: I): I };
>b : (x: any) => any
>x : any

var d: { [x: I]: I };
>d : {}
>x : any

var e = (x: I) => { var y: I; return y; }
>e : (x: any) => any
>(x: I) => { var y: I; return y; } : (x: any) => any
>x : any
>y : any
>y : any

function f(x: I): I { var y: I; return y; }
>f : (x: any) => any
>x : any
>y : any
>y : any

var g = function f(x: I): I { var y: I; return y; }
>g : (x: any) => any
>function f(x: I): I { var y: I; return y; } : (x: any) => any
>f : (x: any) => any
>x : any
>y : any
>y : any

class D extends I {
>D : D
>I : any
}

interface U extends I {}

module M {
    export interface E<T> { foo: T }
>foo : T
}

class D2 extends M.C { }
>D2 : D2
>M.C : any
>M : any
>C : any

interface D3<T extends M.E> { }
>M : any

interface I2 extends M.C { }
>M : any

function h<T extends I>(x: T) { }
>h : <T extends any>(x: T) => void
>x : T

function i<T extends M.E>(x: T) { }
>i : <T extends any>(x: T) => void
>M : any
>x : T

var j = <C>null;
>j : any
><C>null : any
>null : null

var k = <M.E>null;
>k : any
><M.E>null : any
>M : any
>null : null