You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The same interpolate expression without using a "let/var" worked just as expected. It turns out the reason was that the color strings (eg "#edf8e9" were getting implicitly coerced to the "color" type because that's the expected type for the fill-color property. Inside the let expression though, the implicit coercion didn't happen.
That undefined should actually be context.expectedType, in order to correctly set the let expression's result type. It looks like we're already doing that in native:
This showed up in a bug report as a somewhat cryptic "Type string is not interpolatable" error for a style property of this form:
The same interpolate expression without using a "let/var" worked just as expected. It turns out the reason was that the color strings (eg "#edf8e9" were getting implicitly coerced to the "color" type because that's the expected type for the
fill-color
property. Inside the let expression though, the implicit coercion didn't happen.I think this is just a mistake here:
mapbox-gl-js/src/style-spec/expression/definitions/let.js
Line 52 in a1233cb
That
undefined
should actually becontext.expectedType
, in order to correctly set the let expression's result type. It looks like we're already doing that in native:https://github.com/mapbox/mapbox-gl-native/blob/a991eec597541c32682946b541e22ccad0f98dd1/src/mbgl/style/expression/let.cpp#L61
cc @malwoodsantoro @mollymerp @ryanhamley
The text was updated successfully, but these errors were encountered: