I can’t get extension methods to work – just doing:
Class Canvas Extension
Caught signal:Memory access violation
Any ideas what I’m doing wrong?
Hmm … works in a little project of it’s own, but not in the middle of my game project 🙁
Can you try and put together a runnable example for me to play with?
I’ll try – so far my extension-only project is working fine and my large project gives the MAV on the simplest extension, but I’m not sure what it is about it that causes it.
Related question – any chance of allowing extension overload methods? E.g. an alternative List<T>.Count() method with parameters? At present it compiles the overloaded method but gives “can’t find overload for ‘Count(…)’ with argument types (bool(string))” when you try to call it.
> any chance of allowing extension overload methods?
This should be possible eventually. Will be returning to operator to: and extensions soon-ish.
I haven’t been able to track the MAV down yet, but it appears that I can mitigate it by changing the #Include order.
If I #Include the extension classes at the very end, after all other classes, then they work.
If I #Include them earlier (e.g. I originally had them in alphabetical order) then I get the MAV.
But it’s not as simple as just order, as I can also fix the MAV by commenting out some of my other includes, so it’s some combination of my code and #Include order … will keep looking.
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.