From 750a72e8314b61bc668177be1e6dc345f828370d Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 8 Jan 2018 12:42:47 -0800 Subject: [core] Enable implicit type assertions for array types --- platform/node/test/ignores.json | 3 --- 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 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() && actual == type::Value) { + parsed = { std::make_unique(expected->get(), std::move(*parsed)) }; } else if ((*expected == type::String || *expected == type::Number || *expected == type::Boolean) && actual == type::Value) { parsed = wrapForType(*expected, std::move(*parsed)); } -- cgit v1.2.1