mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Allow natspec comments on state variables.
This commit is contained in:
@@ -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.
|
||||
+6
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user