Please allow unary and binary operators to be members of a type, because often they need to access private members. For example:
Type MyType
Private:
Value As Integer
Public:
'' Constructors and other members
Declare Operator Not As MyType
Declare Operator = (MyType rhs) As Boolean
Declare Operator < (MyType rhs) As Boolean
End Type
Operator MyType.Not As MyType
Return Type<MyType>(Not This.Value)
End Operator
Operator MyType.= (MyType rhs) As Boolean
Return This.Value = rhs.Value
End Operator
Operator MyType.< (<yType rhs) As Boolean
Return This.Value < rhs. Value
End Operator
Sorry for the typos.
(MyType rhs)and(<yType rhs)should be(rhs As MyType).Last edit: Rule 2020-12-05
Also see [bugs:#902] and [bugs:#903]
Related
Bugs: #902
Bugs: #903