Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Use local order instead of global OperatorCounter #51

Open
@bergus

Description

@bergus

I've read the current PROTOSPEC.md and tripped over the behavior of the [[OperatorCounter]] internal slot. It is initialised when the operator set is created, and informs the dispatch resolution:

if a's operator set has a lower [[OperatorCounter]] than b's operator set, …

This seems hazardous. The resolution of overloaded operators would depend on execution order of the modules that did create the operator set, and thereby on import order in modules possibly located far away from the usage of the overloads. This is fragile and will easily break.

Instead, I suggest that the resolution of an operator should depend on the order in which the respective operand's operator sets were introduced into the local scope wit with operators from declarations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions