diff options
Diffstat (limited to 'src/mbgl/style/expression/coercion.cpp')
-rw-r--r-- | src/mbgl/style/expression/coercion.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mbgl/style/expression/coercion.cpp b/src/mbgl/style/expression/coercion.cpp index 11172a3668..f5a4d70f66 100644 --- a/src/mbgl/style/expression/coercion.cpp +++ b/src/mbgl/style/expression/coercion.cpp @@ -68,7 +68,7 @@ EvaluationResult toColor(const Value& colorValue) { } Coercion::Coercion(type::Type type_, std::vector<std::unique_ptr<Expression>> inputs_) : - Expression(std::move(type_)), + Expression(Kind::Coercion, std::move(type_)), inputs(std::move(inputs_)) { assert(!inputs.empty()); @@ -138,7 +138,8 @@ void Coercion::eachChild(const std::function<void(const Expression&)>& visit) co }; bool Coercion::operator==(const Expression& e) const { - if (auto rhs = dynamic_cast<const Coercion*>(&e)) { + if (e.getKind() == Kind::Coercion) { + auto rhs = static_cast<const Coercion*>(&e); return getType() == rhs->getType() && Expression::childrenEqual(inputs, rhs->inputs); } return false; |