Skip to content

Access to constants through contract names #1290

Closed as not planned
Closed as not planned
@ethernomad

Description

@ethernomad

It is currently possible to do this:

pragma solidity ^0.4.3;

contract Constants {

    uint constant FLAG = 0x1;
}

contract Test is Constants {

    function x() returns (uint) {
        return Constants.FLAG;
    }
}

But surely it should be possible to do this:

pragma solidity ^0.4.3;

contract Constants {

    uint constant FLAG = 0x1;
}

contract Test {

    function x() returns (uint) {
        return Constants.FLAG;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    annoys users 😢closed due inactivityThe issue/PR was automatically closed due to inactivity.help wantedlanguage design :rage4:Any changes to the language, e.g. new featureslow effortThere is not much implementation work to be done. The task is very easy or tiny.low impactChanges are not very noticeable or potential benefits are limited.staleThe issue/PR was marked as stale because it has been open for too long.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions