Skip to content

Reconsider operators on ContractType #11700

@hrkrshnn

Description

@hrkrshnn
contract Test {}
contract Derived is Test {}
function f(Test a, Test b) {
    a < b;
    a == b;
    a > b;
    a <= b;
    a >= b;
}

function g(Derived a, Test b) {
    a < b;
    a == b;
    a > b;
    a <= b;
    a >= b;
}

Currently, the above code compiles. I think the comparison operators does not belong with the ContractType. Even the equality operator is questionable. Disallowing all these operators is especially important to be consistent with how operators are disallowed by default in user defined types: #11531.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Deprecate Only

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions