Skip to content

Get a hold of getter/setter function #13389

Closed
@DartBot

Description

@DartBot

This issue was originally filed by Misko.H...@gmail.com


class Foo {
  String _foo;

  get foo() => _foo;

  method() => null;
}

I can closures a method like this

Function method = (new Foo()).method;

This allows me to pass the method closure into callbacks of other API. It is equally useful to pass closure for getter or setter functions. But there is no way to closures the getter/setter. The following code snippet returns a value rather then closurized function.

(new Foo()).method; // returns value rather then function closure which returns a value

Perhaps some other syntax by which I could get a hold of the getter/setter?

Metadata

Metadata

Assignees

Labels

area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).type-enhancementA request for a change that isn't a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions