From 70de9d452b0c8e2680816214d28c6baf4f791a44 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Thu, 25 Jan 2024 21:27:09 -0800 Subject: [PATCH] Add test for file level `using for` statements (#831) --- .../projects/solc-8/contracts/Contract_solc8.sol | 5 ++++- .../projects/solc-8/contracts/Library_solc8.sol | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 test/integration/projects/solc-8/contracts/Library_solc8.sol diff --git a/test/integration/projects/solc-8/contracts/Contract_solc8.sol b/test/integration/projects/solc-8/contracts/Contract_solc8.sol index 41a69b1..1fa3162 100644 --- a/test/integration/projects/solc-8/contracts/Contract_solc8.sol +++ b/test/integration/projects/solc-8/contracts/Contract_solc8.sol @@ -2,10 +2,13 @@ pragma solidity >=0.8.0 <0.9.0; pragma abicoder v2; +import "./Library_solc8.sol"; + error InvalidSomeAddress(address someAddress); -contract ContractA { +using Library_solc8 for uint256; +contract ContractA { mapping(bytes32 key => uint256) public authorization; address public someAddress; diff --git a/test/integration/projects/solc-8/contracts/Library_solc8.sol b/test/integration/projects/solc-8/contracts/Library_solc8.sol new file mode 100644 index 0000000..f7556ae --- /dev/null +++ b/test/integration/projects/solc-8/contracts/Library_solc8.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0 <0.9.0; + +library Library_solc8 { + uint constant x = 1; + function a() public view returns (uint) { + return x; + } +} \ No newline at end of file