use of com.redhat.ceylon.compiler.typechecker.tree.Message in project ceylon-compiler by ceylon.
the class DeclarationErrorVisitor method planAccordingToErrors.
/**
* Update the plan according to the errors on the node
*/
private void planAccordingToErrors(Node that) {
List<Message> errors = that.getErrors();
for (Message message : errors) {
if (isError(that, message)) {
TransformationPlan plan;
/*if (message.getCode() == MEMBER_HAS_WRONG_NUMBER_OF_PARAMETERS
&& model.isActual()
&& model.isClassMember()) {
plan = new ThrowerMethod(that, message);
} else if (message.getCode() == TYPE_OF_PARAMETER_IS_DIFFERENT_TO_CORRESPONDING_PARAMETER
&& model.isActual()
&& model.isClassMember()) {
plan = new ThrowerMethod(that, message);
} else if (message.getCode() == COULD_NOT_DETERMINE_PARAMETER_TYPE_SAME_AS_CORRESPONDING_PARAMETER
&& model.isActual()
&& model.isClassMember()) {
plan = new ThrowerMethod(that, message);
} else if ((message.getCode() == REFINED_MEMBER_WRONG_NUM_PL
|| message.getCode() == MISSING_PL_FUNCTION_DECL)
&& model.isActual()
&& model.isClassMember()) {
plan = new ThrowerMethod(that, message);
} else*/
if (message.getCode() == FORMAL_MEMBER_UNIMPLEMENTED_IN_CLASS_HIERARCHY && (model instanceof Class || (model instanceof Value && ((Value) model).getTypeDeclaration().isAnonymous()))) {
plan = new ThrowerMethod(that, message);
} else if (message.getCode() == PL_AND_CONSTRUCTORS && (model instanceof Class || (model instanceof Value && ((Value) model).getTypeDeclaration().isAnonymous()))) {
plan = new ThrowerCatchallConstructor(that, message);
} else {
plan = new Drop(that, message);
}
newplan(plan);
}
}
}