22 lines
1 KiB
Plaintext
22 lines
1 KiB
Plaintext
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorsAreNotContextuallyTyped.ts(4,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorsAreNotContextuallyTyped.ts(7,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
|
|
|
|
==== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorsAreNotContextuallyTyped.ts (2 errors) ====
|
|
// accessors are not contextually typed
|
|
|
|
class C {
|
|
set x(v: (a: string) => string) {
|
|
~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
}
|
|
|
|
get x() {
|
|
~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
return (x: string) => "";
|
|
}
|
|
}
|
|
|
|
var c: C;
|
|
var r = c.x(''); // string |