support for OperatorDeclarationSyntax
Closed this issue · 5 comments
dszryan commented
is it possible to generate static bool operator ==
operations in a class?
MilleBo commented
Hey,
Sadly I haven't implemented override of operators yet. But I can look at it if it's something that you need?
dszryan commented
yes, please. need it for completeness of IEquatable implementation
MilleBo commented
I have uploaded a new version (0.17.0) that hopefully have what you are looking for. You simply specify it when creating the method. For example:
var method = new MethodBuilder("MyMethod")
.WithModifiers(Modifiers.Public, Modifiers.Static)
.WithOperatorOverloading(Operators.Equal)
.WithBody(BodyGenerator.Create())
.Build();
It should give you:
public static MyMethod operator ==() { }
dszryan commented
thank you :)
dszryan commented
worked perfectly.