38 lines
2.2 KiB
Plaintext
38 lines
2.2 KiB
Plaintext
==== tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts (12 errors) ====
|
|
class LanguageSpec_section_4_5_error_cases {
|
|
public set AnnotatedSetter_SetterFirst(a: number) { }
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
public get AnnotatedSetter_SetterFirst() { return ""; }
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
~~
|
|
!!! error TS2323: Type 'string' is not assignable to type 'number'.
|
|
|
|
public get AnnotatedSetter_SetterLast() { return ""; }
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
~~
|
|
!!! error TS2323: Type 'string' is not assignable to type 'number'.
|
|
public set AnnotatedSetter_SetterLast(a: number) { }
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
|
|
public get AnnotatedGetter_GetterFirst(): string { return ""; }
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
public set AnnotatedGetter_GetterFirst(aStr) { aStr = 0; }
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
~~~~
|
|
!!! error TS2323: Type 'number' is not assignable to type 'string'.
|
|
|
|
public set AnnotatedGetter_GetterLast(aStr) { aStr = 0; }
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
~~~~
|
|
!!! error TS2323: Type 'number' is not assignable to type 'string'.
|
|
public get AnnotatedGetter_GetterLast(): string { return ""; }
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
} |