blob: 1a0aaa113355ea4783c32c0275e90815512cf5d7 [file] [log] [blame]
library;
import self as self;
import "dart:core" as core;
import "dart:mirrors" as mir;
import "dart:mirrors";
class _FailingTest extends core::Object {
const constructor •() self::_FailingTest
: super core::Object::•()
;
}
class MyTest extends core::Object {
synthetic constructor •() self::MyTest
: super core::Object::•()
;
@self::failingTest
method foo() void {}
}
abstract class _MyTest2&Object&MyTest extends core::Object implements self::MyTest {
const synthetic constructor •() self::_MyTest2&Object&MyTest
: super core::Object::•()
;
@self::failingTest
method foo() void {}
}
class MyTest2 extends self::_MyTest2&Object&MyTest {
synthetic constructor •() self::MyTest2
: super self::_MyTest2&Object&MyTest::•()
;
}
static const field self::_FailingTest failingTest = const self::_FailingTest::•();
static method main() dynamic {
mir::ClassMirror classMirror = mir::reflectClass(self::MyTest2);
classMirror.{mir::ClassMirror::instanceMembers}.{core::Map::forEach}((core::Symbol symbol, mir::MethodMirror memberMirror) core::Null {
if(memberMirror.{mir::DeclarationMirror::simpleName}.{core::Symbol::==}(#foo)) {
core::print(memberMirror);
core::print(self::_hasFailingTestAnnotation(memberMirror));
}
});
}
static method _hasFailingTestAnnotation(mir::MethodMirror method) core::bool {
core::bool r = self::_hasAnnotationInstance(method, self::failingTest);
core::print("[_hasFailingTestAnnotation] ${method} ${r}");
return r;
}
static method _hasAnnotationInstance(mir::DeclarationMirror declaration, dynamic instance) core::bool
return declaration.{mir::DeclarationMirror::metadata}.{core::Iterable::any}((mir::InstanceMirror annotation) core::bool {
core::print("annotation: ${annotation.{mir::InstanceMirror::reflectee}}");
return core::identical(annotation.{mir::InstanceMirror::reflectee}, instance);
});