aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorVoR0220 <catalanor0220@gmail.com>2016-03-30 04:08:51 +0800
committerVoR0220 <catalanor0220@gmail.com>2016-05-10 00:41:02 +0800
commit4b749fc33335cee2de50e31776ddae1f73649a7b (patch)
treea8f28bbb649a1f4e80845aaef5a9b34c2f6c4f05 /libsolidity/analysis
parent4d283b2b304f9c9a85fb6f03346cc7c9d0054daa (diff)
downloaddexon-solidity-4b749fc33335cee2de50e31776ddae1f73649a7b.tar.gz
dexon-solidity-4b749fc33335cee2de50e31776ddae1f73649a7b.tar.zst
dexon-solidity-4b749fc33335cee2de50e31776ddae1f73649a7b.zip
changed names for Rational Constants and categories
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index ad93b38c..fb0c665c 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -773,8 +773,8 @@ bool TypeChecker::visit(VariableDeclarationStatement const& _statement)
// Infer type from value.
solAssert(!var.typeName(), "");
if (
- valueComponentType->category() == Type::Category::NumberConstant &&
- !dynamic_pointer_cast<ConstantNumberType const>(valueComponentType)->integerType()
+ valueComponentType->category() == Type::Category::RationalNumber &&
+ !dynamic_pointer_cast<RationalNumberType const>(valueComponentType)->integerType()
)
fatalTypeError(_statement.initialValue()->location(), "Invalid integer constant " + valueComponentType->toString() + ".");
var.annotation().type = valueComponentType->mobileType();
@@ -799,8 +799,8 @@ bool TypeChecker::visit(VariableDeclarationStatement const& _statement)
void TypeChecker::endVisit(ExpressionStatement const& _statement)
{
- if (type(_statement.expression())->category() == Type::Category::NumberConstant)
- if (!dynamic_pointer_cast<ConstantNumberType const>(type(_statement.expression()))->integerType())
+ if (type(_statement.expression())->category() == Type::Category::RationalNumber)
+ if (!dynamic_pointer_cast<RationalNumberType const>(type(_statement.expression()))->integerType())
typeError(_statement.expression().location(), "Invalid integer constant.");
}
@@ -1106,7 +1106,7 @@ bool TypeChecker::visit(FunctionCall const& _functionCall)
auto const& argType = type(*arguments[i]);
if (functionType->takesArbitraryParameters())
{
- if (auto t = dynamic_cast<ConstantNumberType const*>(argType.get()))
+ if (auto t = dynamic_cast<RationalNumberType const*>(argType.get()))
if (!t->integerType())
typeError(arguments[i]->location(), "Integer constant too large.");
}
@@ -1341,7 +1341,7 @@ bool TypeChecker::visit(IndexAccess const& _access)
else
{
expectType(*index, IntegerType(256));
- if (auto numberType = dynamic_cast<ConstantNumberType const*>(type(*index).get()))
+ if (auto numberType = dynamic_cast<RationalNumberType const*>(type(*index).get()))
{
if (numberType->denominator() != 1)
typeError(_access.location(), "Invalid type for array access.");
@@ -1372,7 +1372,7 @@ bool TypeChecker::visit(IndexAccess const& _access)
else
{
index->accept(*this);
- if (auto length = dynamic_cast<ConstantNumberType const*>(type(*index).get()))
+ if (auto length = dynamic_cast<RationalNumberType const*>(type(*index).get()))
resultType = make_shared<TypeType>(make_shared<ArrayType>(
DataLocation::Memory,
typeType.actualType(),
@@ -1391,7 +1391,7 @@ bool TypeChecker::visit(IndexAccess const& _access)
else
{
expectType(*index, IntegerType(256));
- if (auto integerType = dynamic_cast<ConstantNumberType const*>(type(*index).get()))
+ if (auto integerType = dynamic_cast<RationalNumberType const*>(type(*index).get()))
if (bytesType.numBytes() <= integerType->literalValue(nullptr))
typeError(_access.location(), "Out of bounds array access.");
}