TypeScript/tests/baselines/reference/propertyWrappedInTry.errors.txt
2014-07-23 12:07:46 -07:00

38 lines
916 B
Plaintext

==== tests/cases/compiler/propertyWrappedInTry.ts (9 errors) ====
class Foo {
try {
~~~
!!! Unexpected token. A constructor, method, accessor, or property was expected.
public bar = someInitThatMightFail();
~~~~~~
!!! Statement expected.
~~~
!!! Cannot find name 'bar'.
~~~~~~~~~~~~~~~~~~~~~
!!! Cannot find name 'someInitThatMightFail'.
} catch(e) {}
public baz() {
~~~~~~
!!! Declaration or statement expected.
~
!!! ';' expected.
~~~
!!! Cannot find name 'baz'.
return this.bar; // doesn't get rewritten to Foo.bar.
~~~~~~
!!! A 'return' statement can only be used within a function body.
}
}
~
!!! Declaration or statement expected.