Allow enum values for constants.

This commit is contained in:
chriseth
2017-03-13 13:30:23 +01:00
parent 49cfacced2
commit 14948e514d
2 changed files with 4 additions and 2 deletions
+4 -1
View File
@@ -1466,7 +1466,10 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess)
}
// TODO some members might be pure, but for example `address(0x123).balance` is not pure
// although every subexpression is, so leaving this to false for now.
// although every subexpression is, so leaving this limited for now.
if (auto tt = dynamic_cast<TypeType const*>(exprType.get()))
if (tt->actualType()->category() == Type::Category::Enum)
annotation.isPure = true;
return false;
}