TypeScript/tests/baselines/reference/propertyWrappedInTry.errors.txt

38 lines
1 KiB
Text
Raw Normal View History

2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/propertyWrappedInTry.ts (9 errors) ====
class Foo {
try {
~~~
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
2014-07-13 01:04:16 +02:00
public bar = someInitThatMightFail();
~~~~~~
!!! error TS1129: Statement expected.
2014-07-13 01:04:16 +02:00
~~~
!!! error TS2304: Cannot find name 'bar'.
2014-07-13 01:04:16 +02:00
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'someInitThatMightFail'.
2014-07-13 01:04:16 +02:00
} catch(e) {}
public baz() {
~~~~~~
!!! error TS1128: Declaration or statement expected.
2014-07-13 01:04:16 +02:00
~
!!! error TS1005: ';' expected.
2014-07-13 01:04:16 +02:00
~~~
!!! error TS2304: Cannot find name 'baz'.
2014-07-13 01:04:16 +02:00
return this.bar; // doesn't get rewritten to Foo.bar.
~~~~~~
!!! error TS1108: A 'return' statement can only be used within a function body.
2014-07-13 01:04:16 +02:00
}
}
~
!!! error TS1128: Declaration or statement expected.
2014-07-13 01:04:16 +02:00