Warn about side-effect free statements.

This commit is contained in:
chriseth
2017-04-21 11:36:38 +02:00
parent ed64c849f5
commit 9bc9fe6af7
5 changed files with 55 additions and 17 deletions
+2 -2
View File
@@ -1674,8 +1674,8 @@ bool TypeChecker::visit(Identifier const& _identifier)
if (auto variableDeclaration = dynamic_cast<VariableDeclaration const*>(annotation.referencedDeclaration))
annotation.isPure = annotation.isConstant = variableDeclaration->isConstant();
else if (dynamic_cast<MagicVariableDeclaration const*>(annotation.referencedDeclaration))
if (auto functionType = dynamic_cast<FunctionType const*>(annotation.type.get()))
annotation.isPure = functionType->isPure();
if (dynamic_cast<FunctionType const*>(annotation.type.get()))
annotation.isPure = true;
return false;
}