Allow natspec comments on state variables.

This commit is contained in:
Alexander Arlt
2020-05-19 11:01:52 -05:00
parent 7d37ed4531
commit af8bb5fb60
21 changed files with 320 additions and 161 deletions
@@ -0,0 +1,7 @@
contract C {
/// @title title
/// @author author
uint private state;
}
// ----
// Warning: (17-56): Documentation tag @title and @author is only allowed on contract definitions. It will be disallowed in 0.7.0.
@@ -0,0 +1,6 @@
contract test {
/// @return returns something
uint private state;
}
// ----
// DocstringParsingError: (18-47): Documentation tag "@return" is only allowed on public state-variables.
@@ -0,0 +1,7 @@
contract C {
/// @notice example of notice
/// @dev example of dev
uint private state;
}
// ----
// Warning: (17-74): Documentation tag on non-public state variables will be disallowed in 0.7.0. You will need to use the @dev tag explicitly.
@@ -1,9 +1,5 @@
contract C {
/// @title example of title
/// @author example of author
/// @notice example of notice
/// @dev example of dev
/// @param example of param
/// @return example of return
uint public state;
}
}
@@ -0,0 +1,9 @@
contract test {
/// @notice example of notice
/// @dev example of dev
/// @return returns something
/// @return returns something
uint public state;
}
// ----
// DocstringParsingError: (18-137): Documentation tag "@return" is only allowed once on state-variables.
@@ -11,3 +11,4 @@ contract C {
}
}
// ----
// Warning: (290-295): Only state variables can have a docstring. This will be disallowed in 0.7.0.