add and test support for fallback functions
This commit is contained in:
parent
3c7155afb0
commit
5b07669bd0
@ -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}'`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user