solidity/test/libsolidity/lsp/goto/lib.sol

53 lines
843 B
Solidity
Raw Normal View History

// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.0;
2021-12-20 13:10:17 +00:00
/// Some Error type E.
error E(uint, uint);
enum Weather {
// ^^^^^^^ @whetherEnum
2021-12-20 13:10:17 +00:00
Sunny,
Cloudy,
Rainy
}
/// Some custom Color enum type holding 3 colors.
enum Color {
// ^^^^^ @ColorEnum
2021-12-20 13:10:17 +00:00
/// Red color.
Red,
// ^^^ @EnumMemberRed
2021-12-20 13:10:17 +00:00
/// Green color.
Green,
/// Blue color.
Blue
}
library Lib
// @ ^^^ @LibLibrary
{
function add(uint a, uint b) public pure returns (uint result)
// ^( @addFunction
// ^^^ @addSymbol
{
result = a + b;
}
// ^) @addFunction
function warningWithUnused() public pure
{
uint unused;
// ^^^^^^^^^^^ @diagnostics
}
}
2021-12-20 13:10:17 +00:00
struct RGBColor
// ^^^^^^^^ @RGBColorStruct
2021-12-20 13:10:17 +00:00
{
uint8 red;
uint8 green;
uint8 blue;
}
// ----
// lib: @diagnostics 2072