TypeScript/tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorsAreNotContextuallyTyped.ts
2014-07-12 17:30:19 -07:00

13 lines
No EOL
201 B
TypeScript

// accessors are not contextually typed
class C {
set x(v: (a: string) => string) {
}
get x() {
return (x: string) => "";
}
}
var c: C;
var r = c.x(''); // string