aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEddie Aftandilian <eaftan@google.com>2020-04-13 13:31:37 -0700
committerJavac Team <javac-team+copybara@google.com>2020-04-14 09:50:06 -0700
commit93dfbb6142719cd54bac0f8ae6ab2509c912cb91 (patch)
tree8f19b78901d3de78a2a8f3d30150b00ce429769d
parenteace53d883cdebd6427ef5915ea2048a582ec95c (diff)
downloadturbine-93dfbb6142719cd54bac0f8ae6ab2509c912cb91.tar.gz
Fix NonCanonicalType warnings.
PiperOrigin-RevId: 306298262
-rw-r--r--java/com/google/turbine/lower/LowerSignature.java14
-rw-r--r--java/com/google/turbine/types/Erasure.java11
-rw-r--r--javatests/com/google/turbine/processing/AbstractTurbineTypesBiPredicateTest.java2
3 files changed, 12 insertions, 15 deletions
diff --git a/java/com/google/turbine/lower/LowerSignature.java b/java/com/google/turbine/lower/LowerSignature.java
index 13a7b9f..a08c7e8 100644
--- a/java/com/google/turbine/lower/LowerSignature.java
+++ b/java/com/google/turbine/lower/LowerSignature.java
@@ -128,15 +128,13 @@ public class LowerSignature {
* unnecessary.
*/
public String methodSignature(
- Env<ClassSymbol, TypeBoundClass> env,
- SourceTypeBoundClass.MethodInfo method,
- ClassSymbol sym) {
+ Env<ClassSymbol, TypeBoundClass> env, TypeBoundClass.MethodInfo method, ClassSymbol sym) {
if (!needsMethodSig(sym, env, method)) {
return null;
}
ImmutableList<Sig.TyParamSig> typarams = tyParamSig(method.tyParams(), env);
ImmutableList.Builder<Sig.TySig> fparams = ImmutableList.builder();
- for (SourceTypeBoundClass.ParamInfo t : method.parameters()) {
+ for (TypeBoundClass.ParamInfo t : method.parameters()) {
if (t.synthetic()) {
continue;
}
@@ -161,7 +159,7 @@ public class LowerSignature {
}
private boolean needsMethodSig(
- ClassSymbol sym, Env<ClassSymbol, TypeBoundClass> env, SourceTypeBoundClass.MethodInfo m) {
+ ClassSymbol sym, Env<ClassSymbol, TypeBoundClass> env, TypeBoundClass.MethodInfo m) {
if ((env.get(sym).access() & TurbineFlag.ACC_ENUM) == TurbineFlag.ACC_ENUM
&& m.name().equals("<init>")) {
// JDK-8024694: javac always expects signature attribute for enum constructors
@@ -176,7 +174,7 @@ public class LowerSignature {
if (m.returnType() != null && needsSig(m.returnType())) {
return true;
}
- for (SourceTypeBoundClass.ParamInfo t : m.parameters()) {
+ for (TypeBoundClass.ParamInfo t : m.parameters()) {
if (t.synthetic()) {
continue;
}
@@ -262,14 +260,14 @@ public class LowerSignature {
private ImmutableList<Sig.TyParamSig> tyParamSig(
Map<TyVarSymbol, TyVarInfo> px, Env<ClassSymbol, TypeBoundClass> env) {
ImmutableList.Builder<Sig.TyParamSig> result = ImmutableList.builder();
- for (Map.Entry<TyVarSymbol, SourceTypeBoundClass.TyVarInfo> entry : px.entrySet()) {
+ for (Map.Entry<TyVarSymbol, TyVarInfo> entry : px.entrySet()) {
result.add(tyParamSig(entry.getKey(), entry.getValue(), env));
}
return result.build();
}
private Sig.TyParamSig tyParamSig(
- TyVarSymbol sym, SourceTypeBoundClass.TyVarInfo info, Env<ClassSymbol, TypeBoundClass> env) {
+ TyVarSymbol sym, TyVarInfo info, Env<ClassSymbol, TypeBoundClass> env) {
String identifier = sym.name();
Sig.TySig cbound = null;
diff --git a/java/com/google/turbine/types/Erasure.java b/java/com/google/turbine/types/Erasure.java
index 9042897..f0a3cf6 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;
@@ -33,7 +32,7 @@ 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 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());
}
diff --git a/javatests/com/google/turbine/processing/AbstractTurbineTypesBiPredicateTest.java b/javatests/com/google/turbine/processing/AbstractTurbineTypesBiPredicateTest.java
index 45e1290..6ea6e72 100644
--- a/javatests/com/google/turbine/processing/AbstractTurbineTypesBiPredicateTest.java
+++ b/javatests/com/google/turbine/processing/AbstractTurbineTypesBiPredicateTest.java
@@ -18,6 +18,8 @@ package com.google.turbine.processing;
import static com.google.common.truth.Truth.assertWithMessage;
+import javax.lang.model.type.TypeMirror;
+import javax.lang.model.util.Types;
/**
* A combo test for {@link TurbineTypes} that compares the behaviour of bipredicates like {@link