Allow the addition of operators in type extensions, and also operators on internal types
This is currently not allowed:
type Foo with
static member (+) (foo1, foo2) = foo1.Bar + foo2.Bar
exercitus vir commented
Yes, I need this too.
Bryan Edds commented
Just ran into this problem today, and worked around it with the scary inline workaround :) Would be nice if this worked and didn't cause any problems elsewhere!
This would help with generic arithmetic on novel types, e.g. http://stackoverflow.com/questions/25346246/why-cant-we-satisfy-f-static-member-constraints-with-type-extensions/25347602#25347602
Don Syme commented
See some commentary here that discusses a related problem and the relevant commpiler code: https://visualfsharp.codeplex.com/workitem/2
Mauricio Scheffer commented
This seems more concrete than http://fslang.uservoice.com/forums/245727-f-language/suggestions/5666323-operator-overloads-problem-in-f but since it can already be done with inline + static type parameters I wonder what would be the benefit of doing it via type extensions.