HasOperatorOverloading

A language trait that specifies that this language allows overloading of operators.

Properties

Link copied to clipboard

A map of operator codes and function names acting as overloaded operators. The key is a pair of the class and HasOperatorCode.operatorCode (ideally created by of) and the value is the name of the function.

Functions

Link copied to clipboard
open fun operatorCodeFor(name: Symbol): String?

Returns the matching operator code for name in overloadedOperatorNames. While overloadedOperatorNames can have multiple entries for a single operator code (e.g. to differentiate between unary and binary ops), we only ever allow one distinct operator code for a specific symbol. If non such distinct operator code is found, null is returned.