File: propertyWrappedInTry.errors.txt

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 (46 lines) | stat: -rw-r--r-- 1,782 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
43
44
45
46
tests/cases/compiler/propertyWrappedInTry.ts(3,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/compiler/propertyWrappedInTry.ts(5,9): error TS1128: Declaration or statement expected.
tests/cases/compiler/propertyWrappedInTry.ts(5,16): error TS2304: Cannot find name 'bar'.
tests/cases/compiler/propertyWrappedInTry.ts(5,22): error TS2304: Cannot find name 'someInitThatMightFail'.
tests/cases/compiler/propertyWrappedInTry.ts(11,5): error TS1128: Declaration or statement expected.
tests/cases/compiler/propertyWrappedInTry.ts(11,12): error TS2304: Cannot find name 'baz'.
tests/cases/compiler/propertyWrappedInTry.ts(11,18): error TS1005: ';' expected.
tests/cases/compiler/propertyWrappedInTry.ts(17,1): error TS1128: Declaration or statement expected.


==== tests/cases/compiler/propertyWrappedInTry.ts (8 errors) ====
    class Foo {
    
        try {
        ~~~
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
    
            public bar = someInitThatMightFail();
            ~~~~~~
!!! error TS1128: Declaration or statement expected.
                   ~~~
!!! error TS2304: Cannot find name 'bar'.
                         ~~~~~~~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'someInitThatMightFail'.
    
        } catch(e) {}
    
    
    
        public baz() {
        ~~~~~~
!!! error TS1128: Declaration or statement expected.
               ~~~
!!! error TS2304: Cannot find name 'baz'.
                     ~
!!! error TS1005: ';' expected.
    
            return this.bar; // doesn't get rewritten to Foo.bar.
    
        }
    
    }
    ~
!!! error TS1128: Declaration or statement expected.