Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve expression type checking error for "match" #5220

Open
anandthakker opened this issue Aug 31, 2017 · 1 comment
Open

Improve expression type checking error for "match" #5220

anandthakker opened this issue Aug 31, 2017 · 1 comment
Labels

Comments

@anandthakker
Copy link
Contributor

Using the following expression as a filter (using branch #5193 at the time of writing):

"filter": {
        "expression": [
          "curve",
          ["step"],
          ["zoom"],
          7,
          "all",
          8,
          [
            "<", [ "number", [ "get", "area" ] ], 80000
            ],
          9,
          [
            "<", [ "number", [ "get", "area" ] ], 20000
            ]
        ]
      }

Produces the error, filter.expression[6]: Expected String but found Boolean instead..

Ideally, the error would have been: filter.expression[4]: Expected Boolean but found String instead
With perhaps a secondary explanation: filter expressions must produce Boolean results
Even better filter.expression[4]: Expected Boolean but found String literal "all" instead

(h/t @aparlato @jfirebaugh )

@jmandel1027
Copy link
Contributor

jmandel1027 commented Feb 13, 2018

Hi @anandthakker is this bug still up for grabs?

Happy to work on it, so this looks like i'd need to update the error case on the expression/parsing_context to have have the improved error message which is evaluated by feature_filter/index.js at run time.

Just wanted to be sure i'm on the right track given the other work being done in this area. 👍

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants