Skip to content

[PPC0030] - Clarifications on use overload interaction #87

@leonerd

Description

@leonerd

The PPC document doesn't actually talk about use overload at all.

In the course of implementing it (Perl/perl5#24304), currently I have fully created an overload category for the equ and === operators, allowing a class to use overload equ => ... to specify its overloading behaviour here.

But I wonder if this should be considered correct, or not. We say that the equ operator's behaviour can be explained in terms of some defined checks and the eq operator. While we allow the eq operator to be overloaded, we don't allow defined to be.

I wonder if therefore, we should say that equ (and related) are not independently overloadable, but instead are just implemented in exactly these terms - a defined check first that cannot be overridden, followed by a possibly-overloaded eq check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions