aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-03-09 20:49:53 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-03-12 19:53:00 +0800
commit2bddebc3d5fc942dc43364a9c4ddfb897768c93d (patch)
tree50c27248ce0f150d551d91a8873ae98547549d31 /Types.cpp
parent3ca37cadddf4f58cef5273c6b49e0f55c1162251 (diff)
downloaddexon-solidity-2bddebc3d5fc942dc43364a9c4ddfb897768c93d.tar.gz
dexon-solidity-2bddebc3d5fc942dc43364a9c4ddfb897768c93d.tar.zst
dexon-solidity-2bddebc3d5fc942dc43364a9c4ddfb897768c93d.zip
Bytes Tokens properly named and NameAndTypeResolution tests work
Diffstat (limited to 'Types.cpp')
-rw-r--r--Types.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Types.cpp b/Types.cpp
index aadd884b..9f307cbc 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -39,7 +39,7 @@ TypePointer Type::fromElementaryTypeName(Token::Value _typeToken)
{
solAssert(Token::isElementaryTypeName(_typeToken), "Elementary type name expected.");
- if (Token::Int <= _typeToken && _typeToken <= Token::Bytes256)
+ if (Token::Int <= _typeToken && _typeToken <= Token::Bytes32)
{
int offset = _typeToken - Token::Int;
int bytes = offset % 33;
@@ -226,8 +226,11 @@ TypePointer IntegerType::binaryOperatorResult(Token::Value _operator, TypePointe
// All integer types can be compared
if (Token::isCompareOp(_operator))
return commonType;
+ // Nothing else can be done with addresses, but hashes can receive bit operators
+ if (commonType->isAddress())
+ return TypePointer();
- return TypePointer();
+ return commonType;
}
const MemberList IntegerType::AddressMemberList =