Closed curiousdannii-testing closed 2 years ago
557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:
Comment by graham :
Fixed, by improving kind-checking at compile time.
557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:
Comment by zarf :
Confirmed. Region expressions seem to produce different conditional I6 code than literal region names.
A simpler way to demonstrate the problem for the above code:
Every turn:
let R be the territory of Crowd 2;
say "R is [R]...";
if the location is in Region 1:
say "Check (1a).";
if the location is in R:
say "Check (1b).";
R is Region 1, but the two tests are compiled differently.
! [3: if the location is in region 1 begin]
if (((TestRegionalContainment(real_location,I125_region_1)))){ ... }
! [6: if the location is in r begin]
if (((tmp_0 == ContainerOf(real_location)))){ ... }
557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:
Comment by zarf :
I think this has to be handled at run-time (given I7's policy of run-time typing for all kinds-of-object). I'm not sure how it would work, though. The "in" in the source code refers to either the containment relation or the regional containment relation, but you can't know which until run-time. This is messy.
The original source code can be fixed by explicitly saying
Every turn when the location is regionally in the territory of Crowd 1, ...
Every turn when the location is regionally in the territory of Crowd 2, ...
Reported by : Shin
Description :
When the regions are object properties, the containment of the current location in a set of nested regions is incorrectly evaluated except for the region directly enclosing the current location.
Steps to reproduce :
Additional information :
imported from: [Mantis 1501] Containment of the location in a set of nested regions incorrectly evaluated.