blob: 51f3a0a0b4ca91f913567eba1a411a1b65564e76 [file] [log] [blame]
context SimpleOO!Class {
constraint BothAbstractOrNot {
guard : self.getMatching().isDefined()
check : self.getMatching().isAbstract = self.isAbstract
message : "Inconsistent value in feature 'abstract' "
+ "of class " + self.name
}
}
@cached
operation SimpleOO!Class getMatching() : Any {
var match := matchTrace.matches.selectOne
(m|m.left = self or m.right = self);
if (not match.isDefined()) { return null; }
if (match.left = self) { return match.right; }
else { return match.left; }
}