Is there a way to find out if a TypeInfo implements a particular interface?
When I try typeInfo.ExtendsType(Typeof<IInterface>) I get Type ‘Unknown@13480224 Ptr’ is not a class type
Are u using the latest version. Mark fixed interfaces issue today (or yesterday ), may be it fixed this case too.
Yep – downloaded around 3 hours ago.
Before that I was having that same problem with returning interfaces – it now all builds okay, but I can’t see a way of asking “does this type implement this interface?”
You can’t yet, only non-extern/non-generic classes are fully implemented right now.
Other types can still be used with variants (so can be used as invoke parameters/return values) but will generate an ‘Unknown’ typeinfo.
Interface support should be pretty easy to add, but support for generic types is a while off yet and I suspect that’ll be what you need next!
Hehe – don’t need generics (yet) 🙂
I’m tying to simplify my unit test framework by dynamically finding test methods (rather than having to add them to a list). I did this in Monkey 1 by looking for classes that implement an ITestable interface, then looking in those classes for parameterless methods that start or end with “Test”. Was trying to replicate this now that M2 has reflection, but stumbling on the interface check.
Got it working for now by just skipping that check 🙂
Ok, interfaces are in but not well tested!
That was quick!
Got that working now – thanks 🙂
You must be logged in to reply to this topic.
Monkey2 is an easy to use, cross platform, games oriented programming language from Blitz Research.