Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dynamic method/instance variable access? #2990

Closed
DartBot opened this issue May 10, 2012 · 2 comments
Closed

Add dynamic method/instance variable access? #2990

DartBot opened this issue May 10, 2012 · 2 comments
Labels
closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented May 10, 2012

This issue was originally filed by @snitko


I'm not sure if this issue is implied by the "add reflection" thread here, but I just wanted to be more specific. I want to be able to do something like this

class Model {

  // ... setting instance variables

  Model(Map fields) {
    fields.forEach((k,v) => this[k] = v);
  }

}

It obviously doesn't work, because this doesn't have a []= method. I would be nice to be able to call methods (in this case, setters) dynamically or maybe even set instance variables names dynamically.

@DartBot
Copy link
Author

DartBot commented May 10, 2012

This comment was originally written by [email protected]


Once the reflection system is in place, this will of course be possible (but it won't look like this). At least that is my understanding. I think this is a duplicate of issue #265.

@sethladd
Copy link
Contributor

Removed Type-Defect label.
Added Type-Enhancement, Duplicate labels.
Marked as being merged into #265.

@DartBot DartBot added Type-Enhancement closed-duplicate Closed in favor of an existing report labels May 11, 2012
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants