summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2018-02-28 15:03:47 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2018-03-01 17:02:26 -0800
commit15ba70b5ff018ec2285e0459bf557d1f61240c41 (patch)
treef8c4bb802a69e227d9acf340640625e85ebc4a3a
parentd5829d0d001c363dab63d19a171e3086754dfcf2 (diff)
downloadqtlocation-mapboxgl-15ba70b5ff018ec2285e0459bf557d1f61240c41.tar.gz
Infer type assertions for object
Cross-ports https://github.com/mapbox/mapbox-gl-js/pull/6243.
-rw-r--r--src/mbgl/style/expression/parsing_context.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mbgl/style/expression/parsing_context.cpp b/src/mbgl/style/expression/parsing_context.cpp
index 0215982209..880772d926 100644
--- a/src/mbgl/style/expression/parsing_context.cpp
+++ b/src/mbgl/style/expression/parsing_context.cpp
@@ -147,7 +147,7 @@ ParseResult ParsingContext::parse(const Convertible& value, TypeAnnotationOption
};
const type::Type actual = (*parsed)->getType();
- if ((*expected == type::String || *expected == type::Number || *expected == type::Boolean) && actual == type::Value) {
+ if ((*expected == type::String || *expected == type::Number || *expected == type::Boolean || *expected == type::Object) && actual == type::Value) {
if (typeAnnotationOption == includeTypeAnnotations) {
parsed = { std::make_unique<Assertion>(*expected, array(std::move(*parsed))) };
}