diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-03-09 20:49:53 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-03-12 19:53:00 +0800 |
commit | 2bddebc3d5fc942dc43364a9c4ddfb897768c93d (patch) | |
tree | 50c27248ce0f150d551d91a8873ae98547549d31 /Types.cpp | |
parent | 3ca37cadddf4f58cef5273c6b49e0f55c1162251 (diff) | |
download | dexon-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.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 = |