Closed yoshisatoyanagisawa closed 10 months ago
One possible case that needs Option 1 is the case where router rules are generated dynamically, for example, by some transpilers.
Option 1. accept an empty list, but an empty list for "and" means matching anything while an empty list for "or" means matching nothing.
This is the canonical way in which and/or are handled in programming, including in speculation rules. I suggest we go this direction.
Thanks for the comments both. For ease of understanding the condition, let's go with Option 1.
When we introduce "and" / "or" syntax to the static routing API, people may set an empty list there. What is an expected behavior for it? I suppose there are two options: Option 1. accept an empty list, but an empty list for "and" means matching anything while an empty list for "or" means matching nothing. Option 2. raise error if an empty list is set to "and" / "or".
Since I do not come up with a use case that need Option 1., I lean on Option 2 to avoid developers to make mistakes. What do you think?