summaryrefslogtreecommitdiff
path: root/include/mbgl/style/expression/literal.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/style/expression/literal.hpp')
-rw-r--r--include/mbgl/style/expression/literal.hpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/mbgl/style/expression/literal.hpp b/include/mbgl/style/expression/literal.hpp
index 44c095bf28..bcae23b1fa 100644
--- a/include/mbgl/style/expression/literal.hpp
+++ b/include/mbgl/style/expression/literal.hpp
@@ -13,12 +13,12 @@ namespace expression {
class Literal : public Expression {
public:
Literal(Value value_)
- : Expression(typeOf(value_))
+ : Expression(Kind::Literal, typeOf(value_))
, value(value_)
{}
Literal(type::Array type_, std::vector<Value> value_)
- : Expression(type_)
+ : Expression(Kind::Literal, type_)
, value(value_)
{}
@@ -31,7 +31,8 @@ public:
void eachChild(const std::function<void(const Expression&)>&) const override {}
bool operator==(const Expression& e) const override {
- if (auto rhs = dynamic_cast<const Literal*>(&e)) {
+ if (e.getKind() == Kind::Literal) {
+ auto rhs = static_cast<const Literal*>(&e);
return value == rhs->value;
}
return false;