Skip to content

HSL Operator overloading #776

@GuusLieben

Description

@GuusLieben

Related problem

No response

Requested feature

Potential syntax:

class TheObject {
    operator fun ++() { ... } // Unary operators
    operator fun +(other) { ... } // Binary/logical operators
}

Both functions would require a return value, would also be nice to integrate this with type declarations, so it is possible to limit the accepted other parameter types (and reject at evaluation if an argument is invalid, either during resolving (if possible) or at interpretation).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions