From 2bddebc3d5fc942dc43364a9c4ddfb897768c93d Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 9 Mar 2015 13:49:53 +0100 Subject: Bytes Tokens properly named and NameAndTypeResolution tests work --- Types.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Types.cpp') 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 = -- cgit