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

52 lines
3 KiB
Plaintext
Raw Normal View History

tests/cases/compiler/gettersAndSettersErrors.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/gettersAndSettersErrors.ts(2,16): error TS2300: Duplicate identifier 'Foo'.
tests/cases/compiler/gettersAndSettersErrors.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/gettersAndSettersErrors.ts(3,16): error TS2300: Duplicate identifier 'Foo'.
tests/cases/compiler/gettersAndSettersErrors.ts(5,12): error TS2300: Duplicate identifier 'Foo'.
tests/cases/compiler/gettersAndSettersErrors.ts(6,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/gettersAndSettersErrors.ts(7,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/gettersAndSettersErrors.ts(11,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/gettersAndSettersErrors.ts(11,17): error TS2379: Getter and setter accessors do not agree in visibility.
tests/cases/compiler/gettersAndSettersErrors.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/gettersAndSettersErrors.ts(12,16): error TS2379: Getter and setter accessors do not agree in visibility.
2014-10-01 02:15:18 +02:00
==== tests/cases/compiler/gettersAndSettersErrors.ts (11 errors) ====
2014-07-13 01:04:16 +02:00
class C {
public get Foo() { return "foo";} // ok
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-10-01 02:15:18 +02:00
~~~
!!! error TS2300: Duplicate identifier 'Foo'.
2014-07-13 01:04:16 +02:00
public set Foo(foo:string) {} // ok
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-10-01 02:15:18 +02:00
~~~
!!! error TS2300: Duplicate identifier 'Foo'.
2014-07-13 01:04:16 +02:00
public Foo = 0; // error - duplicate identifier Foo - confirmed
2014-10-01 20:27:20 +02:00
~~~
!!! error TS2300: Duplicate identifier 'Foo'.
2014-07-13 01:04:16 +02:00
public get Goo(v:string):string {return null;} // error - getters must not have a parameter
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
public set Goo(v:string):string {} // error - setters must not specify a return type
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
}
class E {
private get Baz():number { return 0; }
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
~~~
!!! error TS2379: Getter and setter accessors do not agree in visibility.
2014-07-13 01:04:16 +02:00
public set Baz(n:number) {} // error - accessors do not agree in visibility
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
~~~
!!! error TS2379: Getter and setter accessors do not agree in visibility.
2014-07-13 01:04:16 +02:00
}