summaryrefslogtreecommitdiff
path: root/src/mbgl/style/expression/is_constant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/expression/is_constant.cpp')
-rw-r--r--src/mbgl/style/expression/is_constant.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mbgl/style/expression/is_constant.cpp b/src/mbgl/style/expression/is_constant.cpp
index 577ecf8cb6..b877ed550a 100644
--- a/src/mbgl/style/expression/is_constant.cpp
+++ b/src/mbgl/style/expression/is_constant.cpp
@@ -1,4 +1,6 @@
#include <mbgl/style/expression/is_constant.hpp>
+#include <mbgl/style/expression/collator_expression.hpp>
+
namespace mbgl {
namespace style {
@@ -25,6 +27,13 @@ bool isFeatureConstant(const Expression& expression) {
return false;
}
}
+
+ if (dynamic_cast<const CollatorExpression*>(&expression)) {
+ // Although the results of a Collator expression with fixed arguments
+ // generally shouldn't change between executions, we can't serialize them
+ // as constant expressions because results change based on environment.
+ return false;
+ }
bool featureConstant = true;
expression.eachChild([&](const Expression& e) {