aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-doc
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sol-doc')
-rw-r--r--packages/sol-doc/src/solidity_doc_generator.ts6
-rw-r--r--packages/sol-doc/test/fixtures/contracts/NatspecEverything.sol3
2 files changed, 8 insertions, 1 deletions
diff --git a/packages/sol-doc/src/solidity_doc_generator.ts b/packages/sol-doc/src/solidity_doc_generator.ts
index 513468803..3501e9a52 100644
--- a/packages/sol-doc/src/solidity_doc_generator.ts
+++ b/packages/sol-doc/src/solidity_doc_generator.ts
@@ -1,6 +1,7 @@
import * as _ from 'lodash';
import {
+ AbiDefinition,
ConstructorAbi,
DataItem,
DevdocOutput,
@@ -100,10 +101,13 @@ function _genDocSection(compiledContract: StandardContractOutput): DocSection {
// that's because the type of the events array doesn't have any fields for documentation!
break;
case 'function':
+ case 'fallback':
docSection.methods.push(_genMethodDoc(abiDefinition, compiledContract.devdoc));
break;
default:
- throw new Error(`unknown and unsupported AbiDefinition type '${abiDefinition.type}'`);
+ throw new Error(
+ `unknown and unsupported AbiDefinition type '${(abiDefinition as AbiDefinition).type}'`,
+ );
}
}
diff --git a/packages/sol-doc/test/fixtures/contracts/NatspecEverything.sol b/packages/sol-doc/test/fixtures/contracts/NatspecEverything.sol
index 3dea03c9a..c6ad3db81 100644
--- a/packages/sol-doc/test/fixtures/contracts/NatspecEverything.sol
+++ b/packages/sol-doc/test/fixtures/contracts/NatspecEverything.sol
@@ -16,6 +16,9 @@ contract NatspecEverything {
/// @return publicMethod @return
function publicMethod(int p) public pure returns(int r) { return p; }
+ /// @dev Fallback @dev
+ function () public {}
+
/// @notice externalMethod @notice
/// @dev externalMethod @dev
/// @param p externalMethod @param