File: varBlock.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (103 lines) | stat: -rw-r--r-- 5,331 bytes parent folder | download | duplicates (4)
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
tests/cases/compiler/varBlock.ts(8,18): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(11,22): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/compiler/varBlock.ts(11,22): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
tests/cases/compiler/varBlock.ts(15,17): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(21,18): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(22,22): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(25,21): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(26,26): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(26,35): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(27,29): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(28,35): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(28,45): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(32,13): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(33,18): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(33,26): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(34,21): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(35,27): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(35,37): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(39,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'c' must be of type 'any', but here has type 'number'.
tests/cases/compiler/varBlock.ts(39,17): error TS1039: Initializers are not allowed in ambient contexts.


==== tests/cases/compiler/varBlock.ts (20 errors) ====
    module m2 {
    
        export var a, b2: number = 10, b;
    }
    
    declare module m3 {
        var a, b, c;
        var a1, b1 = 10;
                     ~~
!!! error TS1039: Initializers are not allowed in ambient contexts.
    
        class C {
            constructor (public c = 10);
                         ~~~~~~~~~~~~~
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
                         ~~~~~~~~~~~~~
!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
        }
    }
    
    declare var b = 10;
                    ~~
!!! error TS1039: Initializers are not allowed in ambient contexts.
    
    declare var a2, b2, c2;
    
    
    
    declare var da = 10;
                     ~~
!!! error TS1039: Initializers are not allowed in ambient contexts.
    declare var d3, d4 = 10;
                         ~~
!!! error TS1039: Initializers are not allowed in ambient contexts.
    
    module m3 {
        declare var d = 10;
                        ~~
!!! error TS1039: Initializers are not allowed in ambient contexts.
        declare var d2, d3 = 10, d4 = 10;
                             ~~
!!! error TS1039: Initializers are not allowed in ambient contexts.
                                      ~~
!!! error TS1039: Initializers are not allowed in ambient contexts.
        export declare var dE = 10;
                                ~~
!!! error TS1039: Initializers are not allowed in ambient contexts.
        export declare var d2E, d3E = 10, d4E = 10;
                                      ~~
!!! error TS1039: Initializers are not allowed in ambient contexts.
                                                ~~
!!! error TS1039: Initializers are not allowed in ambient contexts.
    }
    
    declare module m4 {
        var d = 10;
                ~~
!!! error TS1039: Initializers are not allowed in ambient contexts.
        var d2, d3 = 10, d4 =10;
                     ~~
!!! error TS1039: Initializers are not allowed in ambient contexts.
                             ~~
!!! error TS1039: Initializers are not allowed in ambient contexts.
        export var dE = 10;
                        ~~
!!! error TS1039: Initializers are not allowed in ambient contexts.
        export var d2E, d3E = 10, d4E = 10;
                              ~~
!!! error TS1039: Initializers are not allowed in ambient contexts.
                                        ~~
!!! error TS1039: Initializers are not allowed in ambient contexts.
    }
    
    declare var c;
    declare var c = 10;
                ~
!!! error TS2403: Subsequent variable declarations must have the same type.  Variable 'c' must be of type 'any', but here has type 'number'.
!!! related TS6203 tests/cases/compiler/varBlock.ts:38:13: 'c' was also declared here.
                    ~~
!!! error TS1039: Initializers are not allowed in ambient contexts.