use of org.eclipse.ceylon.langtools.tools.javac.code.Type.ClassType in project ceylon by eclipse.
the class CeylonEnter method resetClassSymbol.
/**
* This resets a ClassSymbol recursively, for bootstrap
*/
private void resetClassSymbol(ClassSymbol classSymbol) {
// look for inner classes
if (classSymbol.members_field != null) {
for (Symbol member : classSymbol.getEnclosedElements()) {
if (member instanceof ClassSymbol) {
resetClassSymbol((ClassSymbol) member);
}
}
}
// reset its type, we need to keep it
org.eclipse.ceylon.langtools.tools.javac.code.Type.ClassType classType = (ClassType) classSymbol.type;
classType.all_interfaces_field = null;
classType.interfaces_field = null;
classType.supertype_field = null;
classType.typarams_field = null;
// make sure we give erroneous types a second chance
if (classType.getTag() == TypeTag.ERROR) {
// This is how ClassSymbol's constructor builds them, so make'em brand new
classSymbol.type = new ClassType(org.eclipse.ceylon.langtools.tools.javac.code.Type.noType, null, null);
classSymbol.type.tsym = classSymbol;
}
// reset its members and completer
classSymbol.members_field = null;
classSymbol.completer = null;
// make sure we revert the class symbol kind to a new state by removing ERR kinds
classSymbol.kind = Kinds.TYP;
classSymbol.flags_field = 0;
}
Aggregations