Opened 2 years ago
#23199 new defect
Using placeholders and selector classes breaks validator
| Reported by: | VAis4mappers | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Core validator | Version: | latest |
| Keywords: | Cc: |
Description
I've come across this problem in using the validator. This works in removing the "phone" tag:
*["name"] { set name; } *["phone"] { throwWarning: "{0.key} not in a standard format"; fixRemove: tr("{0}", "{0.key}"); } /* warns "phone not in a standard format" */
While this does not:
*["name"] { set name; } *["phone"].name { throwWarning: "{0.key} not in a standard format"; fixRemove: tr("{0}", "{0.key}"); } /* warns "phone not in a standard format" */
The only difference is that I've added the "name" class to the selector in the second example. Both examples throw the warning properly, but only the first successfully removes the "phone" tag. Using fixRemove: "{0.key}"; on line 7 also works in the first example but not the second.
Note that these examples are silly and useless, but have come up in more complex, useful rules I've been trying to make, and I think this is the (or one of the) root causes. Another would be a function to get list slices but that is a separate issue :) Is this expected behavior? I'm on version 18822. Yes, I know I could write rules such that I don't need to use classes but would prefer not to. Thanks!


