diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2018-01-08 12:42:47 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2018-01-09 16:13:26 -0800 |
commit | a4ab4f68e2d2b927dea139b1945f8810ab215a9e (patch) | |
tree | 7dcdabb65cc01adfbd2094c04f100c2acdbe145c | |
parent | a13027c1b6e2aa9a213628acf9124cd6c872f204 (diff) | |
download | qtlocation-mapboxgl-a4ab4f68e2d2b927dea139b1945f8810ab215a9e.tar.gz |
[core] Enable implicit type assertions for array types
-rw-r--r-- | platform/node/test/ignores.json | 3 | ||||
-rw-r--r-- | src/mbgl/style/expression/parsing_context.cpp | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/platform/node/test/ignores.json b/platform/node/test/ignores.json index 6e551f9daa..bde950ca9c 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/interpolate/linear-color": "https://github.com/mapbox/mapbox-gl-native/issues/10604", "expression-tests/to-rgba/alpha": "https://github.com/mapbox/mapbox-gl-native/issues/10604", diff --git a/src/mbgl/style/expression/parsing_context.cpp b/src/mbgl/style/expression/parsing_context.cpp index 8dd99dd8d0..acf3e63a48 100644 --- a/src/mbgl/style/expression/parsing_context.cpp +++ b/src/mbgl/style/expression/parsing_context.cpp @@ -148,6 +148,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)); } |