Compare categories instead of types in ContractCompiler(740)

This commit is contained in:
Jason Cobb
2020-04-28 13:13:45 -04:00
parent 55e34407d3
commit 8973732b74
2 changed files with 16 additions and 1 deletions
+4 -1
View File
@@ -733,7 +733,10 @@ bool ContractCompiler::visit(InlineAssembly const& _inlineAssembly)
{
case Type::Category::Bool:
case Type::Category::Address:
solAssert(*type == *variable->annotation().type, "");
// Either both the literal and the variable are bools, or they are both addresses.
// If they are both bools, comparing category is the same as comparing the types.
// If they are both addresses, compare category so that payable/nonpayable is not compared.
solAssert(type->category() == variable->annotation().type->category(), "");
value = type->literalValue(literal);
break;
case Type::Category::StringLiteral: