GNOME Bugzilla – Bug 681097
extension methods support
Last modified: 2018-05-22 14:27:21 UTC
Talking with a Banshee developper last week, and I learned about the "Extension Methods", I was told it can be quite useful sometime. I find it nifty too, and I can imagine the implementation in Vala might not be so hard. http://msdn.microsoft.com/en-us/library/bb383977.aspx Is this something that has been considered and rejected before?
Created attachment 273242 [details] [review] Add support for extension methods I decided to implement the C# syntax, so one has to either add an [Extension] attribute or use `this' as modifier to the instance parameter. The only notable difference is that extension methods must be declared in namespaces (since Vala has no static classes) - this includes the root namespace. Fixes bug 681097
Thanks for the work. However rather than that ugly parameter, wouldn't it be possible to do something like: extend Some.Class { public void method () { ... } }
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/309.