-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #396 from protofire/fix/disable-func-visibility-fo…
…r-free-functions fix: skip free functions on func-visibility
- Loading branch information
Showing
3 changed files
with
128 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
const CONTRACTS_FREE_FUNCTIONS_ERRORS_2 = ` | ||
function freeAa() returns(bool) { | ||
return true; | ||
} | ||
contract A { | ||
// error here | ||
function functionPublicViewA() returns (uint256) { | ||
return 1; | ||
} | ||
} | ||
function freeBb() returns(bool) { | ||
return true; | ||
} | ||
contract B { | ||
// error here | ||
function functionPublicViewA() returns (uint256) { | ||
return 1; | ||
} | ||
function functionPublicPureB() internal pure returns (bool) { | ||
return true; | ||
} | ||
} | ||
` | ||
|
||
const CONTRACT_FREE_FUNCTIONS_ERRORS_1 = ` | ||
contract A { | ||
constructor() {} | ||
// error here | ||
function functionPublicViewA() returns (uint256) { | ||
return 1; | ||
} | ||
} | ||
function freeBb() returns(bool) { | ||
return true; | ||
} | ||
` | ||
|
||
const NOCONTRACT_FREE_FUNCTION_ERRORS_0 = ` | ||
// NO error here | ||
function functionPublicViewA() returns (uint256) { | ||
return 1; | ||
} | ||
` | ||
|
||
const CONTRACT_FREE_FUNCTIONS_ERRORS_0 = ` | ||
function freeBb() returns(bool) { | ||
return true; | ||
} | ||
contract A { | ||
constructor() {} | ||
// NO error here | ||
function functionPublicViewA() external returns (uint256) { | ||
return 1; | ||
} | ||
} | ||
` | ||
|
||
module.exports = { | ||
CONTRACTS_FREE_FUNCTIONS_ERRORS_2, | ||
CONTRACT_FREE_FUNCTIONS_ERRORS_1, | ||
NOCONTRACT_FREE_FUNCTION_ERRORS_0, | ||
CONTRACT_FREE_FUNCTIONS_ERRORS_0, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters