Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] Enable implicit type assertions for array types
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed Jan 10, 2018
1 parent a13027c commit a4ab4f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 0 additions & 3 deletions platform/node/test/ignores.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/mbgl/style/expression/parsing_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit a4ab4f6

Please sign in to comment.