Commit c38c71e6 authored by Markus Klinik's avatar Markus Klinik
Browse files

Assignment03Rules: small refactoring

parent 6196c114
......@@ -51,14 +51,12 @@ set[Message] a03_shapes_implement_comparable(M3 model)
return { error("There should be two implementations of Geometric: Rectangle and Circle", geometric) };
}
// Rectangle and Circle should only implement Geometric and nothing else
result += union(
{ model.implements[shape] == { geometric }
? {}
: { error("<getName(model,shape)> should implement Geometric and nothing else", shape) }
result +=
{ error("<getName(model,shape)> should implement Geometric and nothing else", shape)
| shape <- shapes
});
, model.implements[shape] != { geometric }
};
// Rectangle and Circle should implement Comparable.compareTo
loc compareTo = |java+method:///java/lang/Comparable/compareTo(T)|;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment