aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-08-31 22:14:54 +0800
committerchriseth <chris@ethereum.org>2017-09-06 19:52:29 +0800
commit1a1db1ec963935bffcabd6115cf99d04fd1d633b (patch)
tree71934fb6b68eb5d090451446042af1cd8cf03f48
parent7886c24d4003beb155b6dba119b92d2df7ec0140 (diff)
downloaddexon-solidity-1a1db1ec963935bffcabd6115cf99d04fd1d633b.tar.gz
dexon-solidity-1a1db1ec963935bffcabd6115cf99d04fd1d633b.tar.zst
dexon-solidity-1a1db1ec963935bffcabd6115cf99d04fd1d633b.zip
Tone down error message.
-rw-r--r--libsolidity/analysis/ViewPureChecker.cpp4
-rw-r--r--test/libsolidity/ViewPureChecker.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/libsolidity/analysis/ViewPureChecker.cpp b/libsolidity/analysis/ViewPureChecker.cpp
index 55f391b7..e5b433c2 100644
--- a/libsolidity/analysis/ViewPureChecker.cpp
+++ b/libsolidity/analysis/ViewPureChecker.cpp
@@ -215,13 +215,13 @@ void ViewPureChecker::reportMutability(StateMutability _mutability, SourceLocati
string text;
if (_mutability == StateMutability::View)
text =
- "Function declared as pure, but this expression reads from the "
+ "Function declared as pure, but this expression (potentially) reads from the "
"environment or state and thus requires \"view\".";
else if (_mutability == StateMutability::NonPayable)
text =
"Function declared as " +
stateMutabilityToString(m_currentFunction->stateMutability()) +
- ", but this expression modifies the state and thus "
+ ", but this expression (potentially) modifies the state and thus "
"requires non-payable (the default) or payable.";
else
solAssert(false, "");
diff --git a/test/libsolidity/ViewPureChecker.cpp b/test/libsolidity/ViewPureChecker.cpp
index fabd1bee..6e99260c 100644
--- a/test/libsolidity/ViewPureChecker.cpp
+++ b/test/libsolidity/ViewPureChecker.cpp
@@ -88,7 +88,7 @@ BOOST_AUTO_TEST_CASE(call_internal_functions_fail)
CHECK_ERROR(
"contract C{ function f() pure { g(); } function g() view {} }",
TypeError,
- "Function declared as pure, but this expression reads from the environment or state and thus requires \"view\""
+ "Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires \"view\""
);
}
@@ -96,7 +96,7 @@ BOOST_AUTO_TEST_CASE(write_storage_fail)
{
CHECK_WARNING(
"contract C{ uint x; function f() view { x = 2; } }",
- "Function declared as view, but this expression modifies the state and thus requires non-payable (the default) or payable."
+ "Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable."
);
}
@@ -131,7 +131,7 @@ BOOST_AUTO_TEST_CASE(environment_access)
CHECK_ERROR(
"contract C { function f() pure { var x = " + x + "; x; } }",
TypeError,
- "Function declared as pure, but this expression reads from the environment or state and thus requires \"view\""
+ "Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires \"view\""
);
}
for (string const& x: pure)