Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler should complete even if contract is not fully implemented #3428

Closed
fulldecent opened this issue Jan 24, 2018 · 2 comments
Closed

Compiler should complete even if contract is not fully implemented #3428

fulldecent opened this issue Jan 24, 2018 · 2 comments

Comments

@fulldecent
Copy link
Contributor

Currently, the compiler will not run if contract/interface methods are left unimplemented.

Instead the compiler should run if there are no syntactical/grammar errors.

Why? Because the compiler parses NatSpec and NatSpec is useful even for incomplete contracts and for interfaces.

screen shot 2018-01-23 at 7 52 08 pm
screen shot 2018-01-23 at 7 52 55 pm
screen shot 2018-01-23 at 7 53 11 pm
screen shot 2018-01-23 at 7 53 14 pm

@axic
Copy link
Member

axic commented Jan 24, 2018

Currently, the compiler will not run if contract/interface methods are left unimplemented.

Please verify that is the case with the Solidity commandline tool (solc). Not sure what exactly "will not run" means, but the screenshots only show fields (apart from the methodHashes) which are relevant for bytecode output.

Remix IDE related issues should not be reported here.

@fulldecent
Copy link
Contributor Author

Thank you @axic, I have followed your advice and confirm solc DOES work as expected. Closing issue. Adding notes. Reporting downstream.

TEST CASE:

pragma solidity ^0.4.19;

/// @title A simulator for Bug Bunny, the most famous Rabbit
/// @author Warned Bros
/// @notice You can use this contract for only the most basic simulation
/// @dev All function calls are currently implement without side effects
interface BugsBunny {
    /// @author Bob Clampett
    /// @notice Determine if Bugs will or will not accept given food
    /// @dev Food must be provided in UTF-8 format
    /// @param _food The name of a food to evaluate (English)
    /// @return true if Bugs will eat it, false otherwise
    function doesEat(string _food) public pure returns (bool);
}

COMMAND:

./solc --devdoc --userdoc bunnyint.sol

OUTPUT:

======= /Users/williamentriken/Desktop/bunnyint.sol:BugsBunny =======
Developer Documentation
{
   "author" : "Warned Bros",
   "methods" : {
      "doesEat(string)" : {
         "author" : "Bob Clampett",
         "details" : "Food must be provided in UTF-8 format",
         "params" : {
            "_food" : "The name of a food to evaluate (English)"
         },
         "return" : "true if Bugs will eat it, false otherwise"
      }
   },
   "title" : "A simulator for Bug Bunny, the most famous Rabbit"
}

User Documentation
{
   "methods" : {
      "doesEat(string)" : {
         "notice" : "Determine if Bugs will or will not accept given food"
      }
   }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants