TypeScript/tests/baselines/reference/propertyWrappedInTry.errors.txt
2014-09-11 16:11:08 -07:00

38 lines
1 KiB
Plaintext

==== tests/cases/compiler/propertyWrappedInTry.ts (9 errors) ====
class Foo {
try {
~~~
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
public bar = someInitThatMightFail();
~~~~~~
!!! error TS1129: 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 TS1005: ';' expected.
~~~
!!! error TS2304: Cannot find name 'baz'.
return this.bar; // doesn't get rewritten to Foo.bar.
~~~~~~
!!! error TS1108: A 'return' statement can only be used within a function body.
}
}
~
!!! error TS1128: Declaration or statement expected.