Merge pull request #8843 from ethereum/deprecate-now

[BREAKING] Deprecate keyword now
This commit is contained in:
chriseth
2020-05-11 16:09:21 +02:00
committed by GitHub
34 changed files with 157 additions and 107 deletions
+14
View File
@@ -2908,6 +2908,20 @@ bool TypeChecker::visit(Identifier const& _identifier)
);
}
if (
MagicVariableDeclaration const* magicVar =
dynamic_cast<MagicVariableDeclaration const*>(annotation.referencedDeclaration)
)
if (magicVar->type()->category() == Type::Category::Integer)
{
solAssert(_identifier.name() == "now", "");
m_errorReporter
.typeError(
_identifier.location(),
"\"now\" has been deprecated. Use \"block.timestamp\" instead."
);
}
return false;
}