From 508aae8a6709f4758753bb1e2ac1f613043c6750 Mon Sep 17 00:00:00 2001 From: Leonardo Alt Date: Wed, 12 Dec 2018 12:03:59 +0100 Subject: Disable state mutability warning for functions with empty body --- libsolidity/analysis/ViewPureChecker.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'libsolidity') diff --git a/libsolidity/analysis/ViewPureChecker.cpp b/libsolidity/analysis/ViewPureChecker.cpp index 1112d682..bd3071b3 100644 --- a/libsolidity/analysis/ViewPureChecker.cpp +++ b/libsolidity/analysis/ViewPureChecker.cpp @@ -156,6 +156,7 @@ void ViewPureChecker::endVisit(FunctionDefinition const& _funDef) m_bestMutabilityAndLocation.mutability < _funDef.stateMutability() && _funDef.stateMutability() != StateMutability::Payable && _funDef.isImplemented() && + !_funDef.body().statements().empty() && !_funDef.isConstructor() && !_funDef.isFallback() && !_funDef.annotation().superFunction -- cgit v1.2.3