[core] Enable implicit type assertions for array types
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user