Skip to content

The Dart VM should provide reflective access to metadata #10906

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

Closed
peter-ahe-google opened this issue May 28, 2013 · 16 comments
Closed

The Dart VM should provide reflective access to metadata #10906

peter-ahe-google opened this issue May 28, 2013 · 16 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. type-enhancement A request for a change that isn't a bug

Comments

@peter-ahe-google
Copy link
Contributor

The Dart VM should support this getter on DeclarationMirror:

/**
 * A list of the metadata associated with this declaration.
 */
List<InstanceMirror> get metadata;

See issue #6614.

@iposva-google
Copy link
Contributor

Removed Priority-Medium label.
Added Priority-Unassigned label.

@iposva-google
Copy link
Contributor

Set owner to @mhausner.
Removed Priority-Unassigned label.
Added Priority-High, Accepted labels.

@gbracha
Copy link
Contributor

gbracha commented Jun 14, 2013

One should now be able to obtain metadata for top level functions, variables and classes as wella s for class members. Libraries and type variables still don't work, but this is progress.

@DartBot
Copy link

DartBot commented Jun 17, 2013

This comment was originally written by @mhausner


Reducing priority since the most useful functionality is implemented.


Removed Priority-High label.
Added Priority-Medium label.

@sethladd
Copy link
Contributor

Hi Matthias,

What is expected to work at this point? I see this simple case works:

import 'dart:mirrors';

const awesome = const Awesome('way cool');

class Awesome {
  final String msg;
  const Awesome(this.msg);
  
  String toString() => msg;
}

@awesome('it works!')
class Cool {
  
}

void main() {
  var classMirror = reflectClass(Cool);
  var metadata = classMirror.metadata;
  var obj = metadata.first.reflectee;
  print(metadata);
  print(obj);
}

Thanks!


Removed Type-Defect label.
Added Type-Enhancement label.

@peter-ahe-google
Copy link
Contributor Author

@DartBot
Copy link

DartBot commented Jun 24, 2013

This comment was originally written by @mhausner


Supported at this time is metadata on:

  • top-level variables, functions, getters and setters
  • classes
  • class members

@rmacnak-google
Copy link
Contributor

Support for metadata on libraries added in r25721.

@gbracha
Copy link
Contributor

gbracha commented Aug 23, 2013

Marked this as blocking #6614.

@iposva-google
Copy link
Contributor

Ryan, can you please list what is still needs to be implemented before we can close this bug?


Set owner to @rmacnak-google.

@rmacnak-google
Copy link
Contributor

I believe metadata for parameters is the only one still missing.

https://chromiumcodereview.appspot.com/23224016/


Added Started label.

@rmacnak-google
Copy link
Contributor

Actually we're also missing metadata on mixin and function typedefs.

@rmacnak-google
Copy link
Contributor

Metadata for mixin and function typedefs added in r26680.

@rmacnak-google
Copy link
Contributor

Metadata for parameters added in r27082.

@rmacnak-google
Copy link
Contributor

Gah, type parameters can have metadata too.

@DartBot
Copy link

DartBot commented Sep 16, 2013

This comment was originally written by [email protected]


Metadata for type parameters added in r27523.

That should be it.


Added Fixed label.

@peter-ahe-google peter-ahe-google added Type-Enhancement area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. labels Sep 16, 2013
@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
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

7 participants