Tests for payable / private combination.

This commit is contained in:
chriseth
2016-09-06 10:58:56 +02:00
parent ff11aa1927
commit 384f189a6a
2 changed files with 22 additions and 2 deletions
+2 -2
View File
@@ -423,9 +423,9 @@ bool TypeChecker::visit(FunctionDefinition const& _function)
typeError(_function.location(), "Library functions cannot be payable.");
if (!_function.isConstructor() && !_function.name().empty() && !_function.isPartOfExternalInterface())
typeError(_function.location(), "Internal functions cannot be payable.");
if (_function.isDeclaredConst())
typeError(_function.location(), "Functions cannot be constant and payable at the same time.");
}
if (_function.isPayable() && _function.isDeclaredConst())
typeError(_function.location(), "Functions cannot be constant and payable at the same time.");
for (ASTPointer<VariableDeclaration> const& var: _function.parameters() + _function.returnParameters())
{
if (!type(*var)->canLiveOutsideStorage())