Skip to content

Commit

Permalink
Clean up some obsolete error recovery logic in TurbineElement
Browse files Browse the repository at this point in the history
Earlier phases now bind an error type if the super type cannot be resolved, the error recovery here is unnecessary.

PiperOrigin-RevId: 677885434
  • Loading branch information
cushon authored and Javac Team committed Sep 23, 2024
1 parent f67d011 commit 67aca02
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions java/com/google/turbine/processing/TurbineElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@
import com.google.turbine.model.Const;
import com.google.turbine.model.Const.ArrayInitValue;
import com.google.turbine.model.TurbineFlag;
import com.google.turbine.tree.Tree;
import com.google.turbine.tree.Tree.MethDecl;
import com.google.turbine.tree.Tree.TyDecl;
import com.google.turbine.tree.Tree.VarDecl;
import com.google.turbine.type.AnnoInfo;
import com.google.turbine.type.Type;
Expand Down Expand Up @@ -266,22 +264,9 @@ public TypeMirror get() {
case CLASS:
case ENUM:
case RECORD:
if (info.superclass() != null) {
if (info.superClassType() != null) {
return factory.asTypeMirror(info.superClassType());
}
if (info instanceof SourceTypeBoundClass) {
// support simple names for stuff that doesn't exist
TyDecl decl = ((SourceTypeBoundClass) info).decl();
if (decl.xtnds().isPresent()) {
ArrayDeque<Tree.Ident> flat = new ArrayDeque<>();
for (Tree.ClassTy curr = decl.xtnds().get();
curr != null;
curr = curr.base().orElse(null)) {
flat.addFirst(curr.name());
}
return factory.asTypeMirror(ErrorTy.create(flat));
}
}
return factory.noType();
case INTERFACE:
case ANNOTATION:
Expand Down

0 comments on commit 67aca02

Please sign in to comment.