go-spatial / fresco

An open source vector tile style editor
https://fresco.go-spatial.org
Apache License 2.0
234 stars 26 forks source link

Expected an even number of arguments mis-counts arrays #89

Closed pnorman closed 4 years ago

pnorman commented 4 years ago

image

The array for line-color has 6 arguments, which is even.

The error is it should have an odd number of arguments.

justenPalmer commented 4 years ago

Hmm, that error is actually being thrown by the Mapbox Gl renderer. I believe match expressions require a default case which would mean one more color after trunk, #d1... I think it starts counting arguments after the expression is declared. So in this case, after match there are five arguments and it is expecting six.

pnorman commented 4 years ago

Ah, it seems like that's the case. Do we have control over the text? If we could say something like "Expected an even number of arguments to "match" expression" it would make it clearer.

justenPalmer commented 4 years ago

Right now I'm just reporting the copy that Mapbox GL generated but we could start putting in some custom messages based on specific fields if the copy is not clear,

pnorman commented 4 years ago

Probably not worth it if there's not many issues with the text. I'll close this and we can revisit if we find a lot of unclear text - or get upstream to change the text.