forked from ethereum/solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlib.sol
52 lines (46 loc) · 843 Bytes
/
lib.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.0;
/// Some Error type E.
error E(uint, uint);
enum Weather {
// ^^^^^^^ @whetherEnum
Sunny,
Cloudy,
Rainy
}
/// Some custom Color enum type holding 3 colors.
enum Color {
// ^^^^^ @ColorEnum
/// Red color.
Red,
// ^^^ @EnumMemberRed
/// 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
}
}
struct RGBColor
// ^^^^^^^^ @RGBColorStruct
{
uint8 red;
uint8 green;
uint8 blue;
}
// ----
// lib: @diagnostics 2072