mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
NatSpec: Implement `@inheritdoc`
This commit is contained in:
committed by
Mathias Baumann
parent
6a1b1283fd
commit
ba0a4de50d
@@ -0,0 +1,7 @@
|
||||
contract C {
|
||||
/// @inheritdoc X
|
||||
function f() internal {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// DocstringParsingError 9397: (17-34): Documentation tag @inheritdoc references inexistent contract "X".
|
||||
@@ -0,0 +1,10 @@
|
||||
contract D {
|
||||
}
|
||||
|
||||
contract C is D {
|
||||
/// @inheritdoc D
|
||||
function f() internal {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// DocstringParsingError 4682: (38-55): Documentation tag @inheritdoc references contract "D", but the contract does not contain a function that is overridden by this function.
|
||||
@@ -0,0 +1,11 @@
|
||||
contract D {
|
||||
struct S { uint a; }
|
||||
}
|
||||
|
||||
contract C is D {
|
||||
/// @inheritdoc D.S
|
||||
function f() internal {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// DocstringParsingError 1430: (63-82): Documentation tag @inheritdoc reference "D.S" is not a contract.
|
||||
@@ -0,0 +1,8 @@
|
||||
contract C {
|
||||
struct S { uint a; }
|
||||
/// @inheritdoc S
|
||||
function f() internal {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// DocstringParsingError 1430: (42-59): Documentation tag @inheritdoc reference "S" is not a contract.
|
||||
@@ -0,0 +1,17 @@
|
||||
contract ERC20 {
|
||||
/// @notice This event is emitted when a transfer occurs.
|
||||
/// @param from The source account.
|
||||
/// @param to The destination account.
|
||||
/// @param amount The amount.
|
||||
/// @dev A test case!
|
||||
event Transfer(address indexed from, address indexed to, uint amount);
|
||||
}
|
||||
|
||||
contract A is ERC20 {
|
||||
/// @inheritdoc ERC20
|
||||
event Transfer();
|
||||
}
|
||||
|
||||
|
||||
// ----
|
||||
// DocstringParsingError 6546: (305-326): Documentation tag @inheritdoc not valid for events.
|
||||
Reference in New Issue
Block a user