"Overloading" service definitions

Hey,
I noticed that “overloading” services with simple and complex types seems to work ok.

Example 1:

apply Service "HTTP" {
...
  assign where host.vars.service.check_http==true
}
apply Service "HTTP" for (var k => var v in host.vars.service.check_http) {
...
  assign where typeof(host.vars.service.check_http)==Dictionary
}

The following does not work (Array and Dictionary), even though it might be practical to be able to use both.

Example 2:

apply Service "HTTP" for (var el in host.vars.service.check_http) {
...
  assign where typeof(host.vars.service.check_http)==Array
}
apply Service "HTTP" for (var k => var v in host.vars.service.check_http) {
...
  assign where typeof(host.vars.service.check_http)==Dictionary
}

Obviously, example 2 isn’t working because the loop is evaluated before “assign where”. As such the loop expecting an Array “sees” a Dict and vice-versa. (Note: assign where typeof(... is redundant in this case).

But: Why, in Example 1, isn’t the loop throwing errors when it “sees” a Boolean? Why is this different from Example 2?

Wouldn’t it make sense to consider only fitting elements in a loop anyway, such that the loop only uses elements that it can actually work on? Much like it seems to be the case with Example 1!?

Cheers,
Marki