aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-10 04:00:39 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-08-14 21:21:47 +0800
commitb225bf5d5364d72d75fab4a6843df665da28b842 (patch)
treeb3ecdd0452e4a159ddfc52ef28e16ea13ea8bc5d
parent1c1388f24178767db8d519b490914b1b8c390bed (diff)
downloaddexon-solidity-b225bf5d5364d72d75fab4a6843df665da28b842.tar
dexon-solidity-b225bf5d5364d72d75fab4a6843df665da28b842.tar.gz
dexon-solidity-b225bf5d5364d72d75fab4a6843df665da28b842.tar.bz2
dexon-solidity-b225bf5d5364d72d75fab4a6843df665da28b842.tar.lz
dexon-solidity-b225bf5d5364d72d75fab4a6843df665da28b842.tar.xz
dexon-solidity-b225bf5d5364d72d75fab4a6843df665da28b842.tar.zst
dexon-solidity-b225bf5d5364d72d75fab4a6843df665da28b842.zip
Remove useless payable & constant typecheck
-rw-r--r--libsolidity/analysis/TypeChecker.cpp2
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp9
2 files changed, 0 insertions, 11 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 8dd45a90..dbc95c4f 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -500,8 +500,6 @@ bool TypeChecker::visit(FunctionDefinition const& _function)
m_errorReporter.typeError(_function.location(), "Library functions cannot be payable.");
if (!_function.isConstructor() && !_function.isFallback() && !_function.isPartOfExternalInterface())
m_errorReporter.typeError(_function.location(), "Internal functions cannot be payable.");
- if (_function.isDeclaredConst())
- m_errorReporter.typeError(_function.location(), "Functions cannot be constant and payable at the same time.");
}
for (ASTPointer<VariableDeclaration> const& var: _function.parameters() + _function.returnParameters())
{
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 13843afa..51d60596 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -4771,15 +4771,6 @@ BOOST_AUTO_TEST_CASE(function_variable_mixin)
CHECK_ERROR(text, DeclarationError, "Identifier already declared.");
}
-
-BOOST_AUTO_TEST_CASE(payable_constant_conflict)
-{
- char const* text = R"(
- contract C { function f() payable constant {} }
- )";
- CHECK_ERROR(text, TypeError, "Functions cannot be constant and payable at the same time.");
-}
-
BOOST_AUTO_TEST_CASE(calling_payable)
{
char const* text = R"(