Remove useless payable & constant typecheck

This commit is contained in:
Alex Beregszaszi 2017-08-09 21:00:39 +01:00
parent 1c1388f241
commit b225bf5d53
2 changed files with 0 additions and 11 deletions

View File

@ -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())
{

View File

@ -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"(