aboutsummaryrefslogtreecommitdiff
path: root/java/com/google/turbine/types/Erasure.java
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2021-07-16 18:34:42 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-07-16 18:34:42 +0000
commitd6118c099b71aac0100cce47f7e5f16cbbfb897e (patch)
treef3960bf41b61a8f29eb4ddc3bdc03da8c15976ab /java/com/google/turbine/types/Erasure.java
parent2a4cb0ec252bf941a985428a368ca7a81707e7d6 (diff)
parent88adfa1e21a5c8e806580f8a1edc6f3669d0d167 (diff)
downloadturbine-d6118c099b71aac0100cce47f7e5f16cbbfb897e.tar.gz
Merge remote-tracking branch 'aosp/upstream-main' am: 54111aedb4 am: aef8ef46bb am: 88adfa1e21
Original change: https://android-review.googlesource.com/c/platform/external/turbine/+/1768552 Change-Id: I8a13cdf80543ff6aae316168500f03801efc7b0c
Diffstat (limited to 'java/com/google/turbine/types/Erasure.java')
-rw-r--r--java/com/google/turbine/types/Erasure.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/java/com/google/turbine/types/Erasure.java b/java/com/google/turbine/types/Erasure.java
index 9042897..4b6fbc1 100644
--- a/java/com/google/turbine/types/Erasure.java
+++ b/java/com/google/turbine/types/Erasure.java
@@ -19,7 +19,6 @@ package com.google.turbine.types;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
-import com.google.turbine.binder.bound.SourceTypeBoundClass;
import com.google.turbine.binder.bound.TypeBoundClass.TyVarInfo;
import com.google.turbine.binder.sym.TyVarSymbol;
import com.google.turbine.type.Type;
@@ -32,8 +31,8 @@ import com.google.turbine.type.Type.TyVar;
import com.google.turbine.type.Type.WildTy;
/** Generic type erasure. */
-public class Erasure {
- public static Type erase(Type ty, Function<TyVarSymbol, SourceTypeBoundClass.TyVarInfo> tenv) {
+public final class Erasure {
+ public static Type erase(Type ty, Function<TyVarSymbol, TyVarInfo> tenv) {
switch (ty.tyKind()) {
case CLASS_TY:
return eraseClassTy((Type.ClassTy) ty);
@@ -70,14 +69,12 @@ public class Erasure {
return ty.bounds().isEmpty() ? ClassTy.OBJECT : erase(ty.bounds().get(0), tenv);
}
- private static Type eraseTyVar(
- TyVar ty, Function<TyVarSymbol, SourceTypeBoundClass.TyVarInfo> tenv) {
- SourceTypeBoundClass.TyVarInfo info = tenv.apply(ty.sym());
+ private static Type eraseTyVar(TyVar ty, Function<TyVarSymbol, TyVarInfo> tenv) {
+ TyVarInfo info = tenv.apply(ty.sym());
return erase(info.upperBound(), tenv);
}
- private static Type.ArrayTy eraseArrayTy(
- Type.ArrayTy ty, Function<TyVarSymbol, SourceTypeBoundClass.TyVarInfo> tenv) {
+ private static Type.ArrayTy eraseArrayTy(Type.ArrayTy ty, Function<TyVarSymbol, TyVarInfo> tenv) {
return ArrayTy.create(erase(ty.elementType(), tenv), ty.annos());
}
@@ -112,4 +109,6 @@ public class Erasure {
erase(ty.parameters(), tenv),
erase(ty.thrown(), tenv));
}
+
+ private Erasure() {}
}