+ // Deal with whatever incomplete ancestors we encountered
+ for (Mutable<?, ?, ?> ancestor : incomplete) {
+ // This check must complete during the ancestor's FULL_DECLARATION phase, i.e. the ancestor must not reach
+ // EFFECTIVE_MODEL until it is done.
+ final ModelActionBuilder action = ancestor.newInferenceAction(ModelProcessingPhase.FULL_DECLARATION);
+ action.apply(new InferenceAction() {
+ @Override
+ public void apply(final InferenceContext ctx) {
+ if (!ancestor.hasSubstatement(KeyEffectiveStatement.class)) {
+ throw new SourceException(stmt, "%s %s is defined within a list that has no key statement",
+ name, stmt.argument());
+ }
+ }
+
+ @Override
+ public void prerequisiteFailed(final Collection<? extends Prerequisite<?>> failed) {
+ throw new VerifyException("Should never happen");
+ }
+ });
+ }