Merge pull request #11350 from ethereum/lsp

Language Server
This commit is contained in:
chriseth
2021-12-16 18:54:26 +01:00
committed by GitHub
22 changed files with 1891 additions and 3 deletions
@@ -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);
}
}
+15
View File
@@ -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
{
}