summaryrefslogtreecommitdiff
path: root/src
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-09 16:13:26 -0800
commita4ab4f68e2d2b927dea139b1945f8810ab215a9e (patch)
tree7dcdabb65cc01adfbd2094c04f100c2acdbe145c /src
parenta13027c1b6e2aa9a213628acf9124cd6c872f204 (diff)
downloadqtlocation-mapboxgl-a4ab4f68e2d2b927dea139b1945f8810ab215a9e.tar.gz
[core] Enable implicit type assertions for array types
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/style/expression/parsing_context.cpp2
1 files changed, 2 insertions, 0 deletions
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));
}