problem about dart-mirrors-Collection of common programming errors
Matt
dart dart-mirrors
I am using mirrors and would like to determine if one ClassMirror is a subtype of another. Sort of something like:ClassMirror type = me.getField(someSymbol).type;// obviously this won’t work, since a ClassMirror is not a List if(type.originalDeclaration is List) {… }Really I’m looking for something like Java’s Class.isAssignableFrom(Class), i.e, a first order isa operator. Walking up the type hierarchy myself feels a bit klunky, especially in the presence of mixins, and would (hopefully) be
Mike Mitterer
dart dart-mirrors
Say I have class RestSimulator {@Path(“/var”) void functionOne() {final Type type = this.runtimeType;final InstanceMirror instanceMirror = reflect(this);final ClassMirror classMirror = instanceMirror.type; final MethodMirror methodMirror = ?????var metadata = methodMirror.metadata;var path = metadata.first.reflectee;print(path.toString()):} }How can I get the MethodMirror for the calling function???[Update] I meant without doing something like final MethodMirror methodMirror = functions[const Sy
Web site is in building