Skip to content
Snippets Groups Projects
Commit 614ff6a9 authored by Michael Leuschel's avatar Michael Leuschel
Browse files

revert to try-catch for detecting recursive types


in datatype destructors

Signed-off-by: default avatarMichael Leuschel <leuschel@uni-duesseldorf.de>
parent 04b74aba
No related branches found
No related tags found
No related merge requests found
Pipeline #129080 passed
...@@ -435,18 +435,21 @@ public class Theories { ...@@ -435,18 +435,21 @@ public class Theories {
final IPrologTermOutput pto) throws CoreException { final IPrologTermOutput pto) throws CoreException {
pto.openTerm(functor); pto.openTerm(functor);
pto.printAtom(id.getIdentifierString()); pto.printAtom(id.getIdentifierString());
final String typeString = getAttributeValue(EventBAttributes.TYPE_ATTRIBUTE); //final String typeString = getAttributeValue(EventBAttributes.TYPE_ATTRIBUTE);
// todo: is there a better way to check if type refers recursively to def? // todo: is there a better way to check if type refers recursively to def?
if (def.getIdentifierString().equals(typeString)) { //if (def.getIdentifierString().equals(typeString)) {
// the the checked theory files tcf no longer contain the type paras // the the checked theory files tcf no longer contain the type paras
// the tuf file may contain org.eventb.theory.core.type="Baum(L)" // the tuf file may contain org.eventb.theory.core.type="Baum(L)"
// the tcf file now contains org.eventb.theory.core.type="Baum" // the tcf file now contains org.eventb.theory.core.type="Baum"
// getType would lead to a CoreException // getType would lead to a CoreException
// we print the type of the recursive data type directly // we print the type of the recursive data type directly
pto.printTypeOfDataType(def,ff,pto); // pto.printTypeOfDataType(def,ff,pto);
} else { //} else {
try {
Type type = id.getType(ff); Type type = id.getType(ff);
printType(type, pto); printType(type, pto);
} catch (CoreException e) {
printTypeOfDataType(def,ff,pto);
} }
pto.closeTerm(); pto.closeTerm();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment