summaryrefslogtreecommitdiff
path: root/include/mbgl/style/conversion/property_value.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/style/conversion/property_value.hpp')
-rw-r--r--include/mbgl/style/conversion/property_value.hpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/mbgl/style/conversion/property_value.hpp b/include/mbgl/style/conversion/property_value.hpp
index b03655a848..4d13144dd7 100644
--- a/include/mbgl/style/conversion/property_value.hpp
+++ b/include/mbgl/style/conversion/property_value.hpp
@@ -33,8 +33,8 @@ struct Converter<PropertyValue<T>> {
ParsingContext ctx(valueTypeToExpressionType<T>());
ParseResult parsed = ctx.parseLayerPropertyExpression(value);
if (!parsed) {
- error = { ctx.getCombinedErrors() };
- return {};
+ error.message = ctx.getCombinedErrors();
+ return nullopt;
}
expression = PropertyExpression<T>(std::move(*parsed));
} else if (isObject(value)) {
@@ -42,29 +42,29 @@ struct Converter<PropertyValue<T>> {
} else {
optional<T> constant = convert<T>(value, error);
if (!constant) {
- return {};
+ return nullopt;
}
return { *constant };
}
if (!expression) {
- return {};
+ return nullopt;
} else if (!(*expression).isFeatureConstant()) {
- error = { "data expressions not supported" };
- return {};
+ error.message = "data expressions not supported";
+ return nullopt;
} else if (!(*expression).isZoomConstant()) {
return { std::move(*expression) };
} else if ((*expression).getExpression().getKind() == Kind::Literal) {
optional<T> constant = fromExpressionValue<T>(
static_cast<const Literal&>((*expression).getExpression()).getValue());
if (!constant) {
- return {};
+ return nullopt;
}
return PropertyValue<T>(*constant);
} else {
assert(false);
- error = { "expected a literal expression" };
- return {};
+ error.message = "expected a literal expression";
+ return nullopt;
}
}
};