summaryrefslogtreecommitdiff
path: root/src/mbgl/style/expression/coercion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/expression/coercion.cpp')
-rw-r--r--src/mbgl/style/expression/coercion.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mbgl/style/expression/coercion.cpp b/src/mbgl/style/expression/coercion.cpp
index 56ab33fcfd..d9cd3ffdc9 100644
--- a/src/mbgl/style/expression/coercion.cpp
+++ b/src/mbgl/style/expression/coercion.cpp
@@ -81,6 +81,13 @@ Coercion::Coercion(type::Type type_, std::vector<std::unique_ptr<Expression>> in
}
}
+std::string Coercion::getOperator() const {
+ return getType().match(
+ [](const type::NumberType&) { return "to-number"; },
+ [](const type::ColorType&) { return "to-color"; },
+ [](const auto&) { assert(false); return ""; });
+}
+
using namespace mbgl::style::conversion;
ParseResult Coercion::parse(const Convertible& value, ParsingContext& ctx) {
static std::unordered_map<std::string, type::Type> types {