summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2018-01-08 12:42:47 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2018-01-08 12:42:47 -0800
commit750a72e8314b61bc668177be1e6dc345f828370d (patch)
treeb4be77dcb3c8651659c206ec4ae17d7614c2bef6
parentdcd7019e7deeff1cb2a7bcaa7748d0f80461a190 (diff)
downloadqtlocation-mapboxgl-upstream/fix-10533.tar.gz
[core] Enable implicit type assertions for array typesupstream/fix-10533
-rw-r--r--platform/node/test/ignores.json3
-rw-r--r--src/mbgl/style/expression/parsing_context.cpp2
2 files changed, 2 insertions, 3 deletions
diff --git a/platform/node/test/ignores.json b/platform/node/test/ignores.json
index 62e042cd4d..f1c72880ba 100644
--- a/platform/node/test/ignores.json
+++ b/platform/node/test/ignores.json
@@ -1,7 +1,4 @@
{
- "expression-tests/array/implicit-1": "https://github.com/mapbox/mapbox-gl-native/issues/10533",
- "expression-tests/array/implicit-2": "https://github.com/mapbox/mapbox-gl-native/issues/10533",
- "expression-tests/array/implicit-3": "https://github.com/mapbox/mapbox-gl-native/issues/10533",
"expression-tests/coalesce/inference": "https://github.com/mapbox/mapbox-gl-native/issues/10588",
"expression-tests/equal/array": "https://github.com/mapbox/mapbox-gl-native/issues/10678",
"expression-tests/equal/color": "https://github.com/mapbox/mapbox-gl-native/issues/10678",
diff --git a/src/mbgl/style/expression/parsing_context.cpp b/src/mbgl/style/expression/parsing_context.cpp
index 501ba2749f..c5e8908248 100644
--- a/src/mbgl/style/expression/parsing_context.cpp
+++ b/src/mbgl/style/expression/parsing_context.cpp
@@ -145,6 +145,8 @@ ParseResult ParsingContext::parse(const Convertible& value)
const type::Type actual = (*parsed)->getType();
if (*expected == type::Color && (actual == type::String || actual == type::Value)) {
parsed = wrapForType(type::Color, std::move(*parsed));
+ } else if (expected->is<type::Array>() && actual == type::Value) {
+ parsed = { std::make_unique<ArrayAssertion>(expected->get<type::Array>(), std::move(*parsed)) };
} else if ((*expected == type::String || *expected == type::Number || *expected == type::Boolean) && actual == type::Value) {
parsed = wrapForType(*expected, std::move(*parsed));
}