This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Style parsing fails for constant expression values #10849
Labels
Core
The cross-platform C++ core, aka mbgl
Milestone
Comments
anandthakker
changed the title
Assertion failed: (false), function operator(), src/mbgl/style/expression/find_zoom_curve.cpp, line 65.
Style parsing fails for constant expression values
Feb 22, 2018
The issue here is that in |
anandthakker
pushed a commit
to mapbox/mapbox-gl-js
that referenced
this issue
Feb 22, 2018
anandthakker
pushed a commit
that referenced
this issue
Feb 22, 2018
anandthakker
added a commit
that referenced
this issue
Feb 22, 2018
* Correctly parse constant expressions in dds style properties Closes #10849 * Clarify
anandthakker
pushed a commit
to mapbox/mapbox-gl-js
that referenced
this issue
Feb 22, 2018
anandthakker
added a commit
to mapbox/mapbox-gl-js
that referenced
this issue
Feb 22, 2018
* Add regression test for mapbox/mapbox-gl-native#10849 * Reduce fixture size
5 tasks
#11282 did not fully fix this issue. The assertion in mapbox-gl-native/include/mbgl/style/conversion/data_driven_property_value.hpp Lines 40 to 51 in c50a74d
fails in the following cases:
The quick fix would be to replace the last three lines above with: optional<T> constant;
if (auto literal = dynamic_cast<Literal*>(expression->get()) {
// cool, it's pre-folded to a literal
constant = fromExpressionValue<T>(literal->getValue());
} else {
// we didn't manage to fold to a literal during parsing, so evaluate it now
EvaluationContext params(nullptr);
EvaluationResult evaluated((*parsed)->evaluate(params));
assert(evaluated); // this assert really should work, since we've already checked above that the expression is zoom- & feature-constant.
constant = fromExpressionValue<T>(*evaluated);
} The fuller fix would be to fix constant folding during parsing to work during every case. |
anandthakker
pushed a commit
to mapbox/mapbox-gl-js
that referenced
this issue
Apr 5, 2018
anandthakker
pushed a commit
that referenced
this issue
Apr 5, 2018
This was referenced Apr 5, 2018
anandthakker
pushed a commit
to mapbox/mapbox-gl-js
that referenced
this issue
Apr 6, 2018
anandthakker
pushed a commit
to mapbox/mapbox-gl-js
that referenced
this issue
Apr 6, 2018
anandthakker
added a commit
to mapbox/mapbox-gl-js
that referenced
this issue
Apr 9, 2018
* Add variations to constant expression test Refs mapbox/mapbox-gl-native#10849 * Clean up ParsingContext#parse() * Resolve "var" binding at parse, not runtime This is simpler, is how native does it, and is helpful for constant folding as it allows evaluating a descendant of "let" without needing a context. * Fix constant folding for var and inferred type annotations * Fix let expression tests, add constant folding tests
anandthakker
added a commit
that referenced
this issue
Apr 9, 2018
* Fix style parsing bug for constant expressions Closes #10849 * Ignore tests for unported GL JS change Refs mapbox/mapbox-gl-js#6429 * Fuller fix * Update mapbox-gl-js
Fixed in #11606 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Triggered by the following style:
cc @anandthakker
The text was updated successfully, but these errors were encountered: