Skip to content

overlapping instances accepted by compiler #189

@d-xo

Description

@d-xo

The following snippet typechecks but should not (note the argument type to the methods for the () instance).

data uint256 = uint256(word);
forall self . class self:ABIAttribs {`
    function headSize(ty:Proxy(self)) -> word;
    function isStatic(ty:Proxy(self)) -> bool;
}

instance ():ABIAttribs {
    function headSize(ty : Proxy(uint256)) -> word { return 0; }
    function isStatic(ty : Proxy(uint256)) -> bool { return true; }
}
instance uint256:ABIAttribs {
    function headSize(ty : Proxy(uint256)) -> word { return 32; }
    function isStatic(ty : Proxy(uint256)) -> bool { return true; }
}

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