-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
When creating conditions for attributes in patterns that refine another pattern, only the attributes of the object type specified in the parent pattern can be used for comparisons.
Example:
- In the SokobanLanguage, add an attribute to Blocks:
class Block extends Boulder {
attr EInt [1] type;
}
- In the BoardPatterns.gt, add a pattern containing two Boulders:
abstract pattern twoBoulders {
fig: Boulder
fig2: Boulder
}
- In the BoardPatterns.gt, add a second pattern refining the previously created pattern, which tries to compare their attributes:
pattern twoBlocks refines twoBoulders {
fig2: Block {
.figId == fig.figId // works
.type == 1 // works
.type == fig.type // fails
}
fig: Block
}
- Rebuild the SolobanRules project.
- In Boardpatterns.gt in the pattern twoBlocks, the second occurrence of type in the line
.type == fig.typeis marked withCould not find attribute 'type'..