File: letDeclarations-invalidContexts.errors.txt

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 (64 lines) | stat: -rw-r--r-- 2,794 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
tests/cases/compiler/letDeclarations-invalidContexts.ts(5,5): error TS1157: 'let' declarations can only be declared inside a block.
tests/cases/compiler/letDeclarations-invalidContexts.ts(7,5): error TS1157: 'let' declarations can only be declared inside a block.
tests/cases/compiler/letDeclarations-invalidContexts.ts(10,5): error TS1157: 'let' declarations can only be declared inside a block.
tests/cases/compiler/letDeclarations-invalidContexts.ts(13,5): error TS1157: 'let' declarations can only be declared inside a block.
tests/cases/compiler/letDeclarations-invalidContexts.ts(17,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
tests/cases/compiler/letDeclarations-invalidContexts.ts(21,5): error TS1157: 'let' declarations can only be declared inside a block.
tests/cases/compiler/letDeclarations-invalidContexts.ts(24,5): error TS1157: 'let' declarations can only be declared inside a block.
tests/cases/compiler/letDeclarations-invalidContexts.ts(27,12): error TS1157: 'let' declarations can only be declared inside a block.
tests/cases/compiler/letDeclarations-invalidContexts.ts(30,29): error TS1157: 'let' declarations can only be declared inside a block.


==== tests/cases/compiler/letDeclarations-invalidContexts.ts (9 errors) ====
    
    
    // Errors, let must be defined inside a block
    if (true) 
        let l1 = 0;
        ~~~~~~~~~~~
!!! error TS1157: 'let' declarations can only be declared inside a block.
    else 
        let l2 = 0;
        ~~~~~~~~~~~
!!! error TS1157: 'let' declarations can only be declared inside a block.
    
    while (true) 
        let l3 = 0;
        ~~~~~~~~~~~
!!! error TS1157: 'let' declarations can only be declared inside a block.
    
    do 
        let l4 = 0;
        ~~~~~~~~~~~
!!! error TS1157: 'let' declarations can only be declared inside a block.
    while (true);
    
    var obj;
    with (obj) 
    ~~~~~~~~~~
!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
        let l5 = 0;
    
    for (var i = 0; i < 10; i++)
        let l6 = 0;
        ~~~~~~~~~~~
!!! error TS1157: 'let' declarations can only be declared inside a block.
    
    for (var i2 in {}) 
        let l7 = 0;
        ~~~~~~~~~~~
!!! error TS1157: 'let' declarations can only be declared inside a block.
    
    if (true) 
        label: let l8 = 0;
               ~~~~~~~~~~~
!!! error TS1157: 'let' declarations can only be declared inside a block.
    
    while (false)
        label2: label3: label4: let l9 = 0;
                                ~~~~~~~~~~~
!!! error TS1157: 'let' declarations can only be declared inside a block.