mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
@@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity >=0.8.0;
|
||||
|
||||
contract C
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity >=0.8.0;
|
||||
|
||||
import './lib.sol';
|
||||
|
||||
contract C
|
||||
{
|
||||
function f(uint a, uint b) public pure returns (uint)
|
||||
{
|
||||
return Lib.add(2 * a, b);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity >=0.8.0;
|
||||
|
||||
library Lib
|
||||
{
|
||||
function add(uint a, uint b) public pure returns (uint result)
|
||||
{
|
||||
result = a + b;
|
||||
}
|
||||
|
||||
function warningWithUnused() public pure
|
||||
{
|
||||
uint unused;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity >=0.8.0;
|
||||
|
||||
contract MyContract
|
||||
{
|
||||
constructor()
|
||||
{
|
||||
uint unused; // [Warning 2072] Unused local variable.
|
||||
}
|
||||
}
|
||||
|
||||
contract D
|
||||
{
|
||||
function main() public payable returns (uint)
|
||||
{
|
||||
MyContract c = new MyContract();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity >=0.8.0;
|
||||
|
||||
contract C
|
||||
{
|
||||
function makeSomeError() public pure returns (uint res)
|
||||
{
|
||||
uint x = "hi";
|
||||
return;
|
||||
res = 2;
|
||||
}
|
||||
}
|
||||
|
||||
contract D
|
||||
{
|
||||
function main() public payable returns (uint)
|
||||
{
|
||||
C c = new C();
|
||||
return c.makeSomeError(2, 3);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity >=0.8.0;
|
||||
|
||||
abstract contract A {
|
||||
function a() public virtual;
|
||||
}
|
||||
|
||||
contract B is A
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user