aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorhydai <z54981220@gmail.com>2018-11-29 16:34:17 +0800
committerhydai <z54981220@gmail.com>2018-11-29 17:07:18 +0800
commit9326adc3db513353da51d9732d1c92b33ecd4d16 (patch)
treeacc49affdc911984d67a37fe7e61c8bc4bca94c6 /libsolidity/analysis
parentb4086ac87037813eb553e92839bbc40de6bbd9ac (diff)
downloaddexon-solidity-9326adc3db513353da51d9732d1c92b33ecd4d16.tar.gz
dexon-solidity-9326adc3db513353da51d9732d1c92b33ecd4d16.tar.zst
dexon-solidity-9326adc3db513353da51d9732d1c92b33ecd4d16.zip
Replace IntegerType(256) with static function IntegerType::uint256()
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index e1a89dd4..fcc6746f 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -2506,7 +2506,7 @@ bool TypeChecker::visit(IndexAccess const& _access)
}
else
{
- expectType(*index, IntegerType(256));
+ expectType(*index, IntegerType::uint256());
if (!m_errorReporter.hasErrors())
if (auto numberType = dynamic_cast<RationalNumberType const*>(type(*index).get()))
{
@@ -2537,7 +2537,7 @@ bool TypeChecker::visit(IndexAccess const& _access)
resultType = make_shared<TypeType>(make_shared<ArrayType>(DataLocation::Memory, typeType.actualType()));
else
{
- expectType(*index, IntegerType(256));
+ expectType(*index, IntegerType::uint256());
if (auto length = dynamic_cast<RationalNumberType const*>(type(*index).get()))
resultType = make_shared<TypeType>(make_shared<ArrayType>(
DataLocation::Memory,
@@ -2556,7 +2556,7 @@ bool TypeChecker::visit(IndexAccess const& _access)
m_errorReporter.typeError(_access.location(), "Index expression cannot be omitted.");
else
{
- if (!expectType(*index, IntegerType(256)))
+ if (!expectType(*index, IntegerType::uint256()))
m_errorReporter.fatalTypeError(_access.location(), "Index expression cannot be represented as an unsigned integer.");
if (auto integerType = dynamic_cast<RationalNumberType const*>(type(*index).get()))
if (bytesType.numBytes() <= integerType->literalValue(nullptr))