com.sun.tools.javac.code.Types.erasureRecursive()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中com.sun.tools.javac.code.Types.erasureRecursive()方法的一些代码示例,展示了Types.erasureRecursive()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Types.erasureRecursive()方法的具体详情如下:
包路径:com.sun.tools.javac.code.Types
类名称:Types
方法名:erasureRecursive

Types.erasureRecursive介绍

暂无

代码示例

代码示例来源:origin: cincheo/jsweet

private static boolean hasMethodType(Types types, Overload overload, JCMethodDecl method) {
  return overload.methods.stream().map(m -> types.erasureRecursive(m.type)).anyMatch(t -> {
    boolean match = t.toString().equals(types.erasureRecursive(method.type).toString());
    if (match && t.tsym.getEnclosingElement() != method.sym.getEnclosingElement()) {
      overload.isValid = false;
    }
    return match;
  });
}

代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac

public Type apply(Type t) { return erasureRecursive(t); }
};

代码示例来源:origin: konsoletyper/teavm-javac

public Type apply(Type t) { return erasureRecursive(t); }
};

代码示例来源:origin: cincheo/jsweet

coreMethod = methods.get(0);
Type coreMethodType = types.erasureRecursive(coreMethod.type);
for (JCMethodDecl m : new ArrayList<>(methods)) {
  if (m == coreMethod) {
    continue;
  if (coreMethodType.toString().equals(types.erasureRecursive(m.type).toString())) {
    methods.remove(m);

代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac

/** @see com.sun.tools.javadoc.ClassDocImpl */
private boolean hasParameterTypes(MethodSymbol method, List<Type> paramTypes) {
  if (paramTypes == null)
    return true;
  if (method.params().size() != paramTypes.size())
    return false;
  List<Type> methodParamTypes = types.erasureRecursive(method.asType()).getParameterTypes();
  return (Type.isErroneous(paramTypes))
    ? fuzzyMatch(paramTypes, methodParamTypes)
    : types.isSameTypes(paramTypes, methodParamTypes);
}

代码示例来源:origin: konsoletyper/teavm-javac

/** @see com.sun.tools.javadoc.ClassDocImpl */
private boolean hasParameterTypes(MethodSymbol method, List<Type> paramTypes) {
  if (paramTypes == null)
    return true;
  if (method.params().size() != paramTypes.size())
    return false;
  List<Type> methodParamTypes = types.erasureRecursive(method.asType()).getParameterTypes();
  return (Type.isErroneous(paramTypes))
    ? fuzzyMatch(paramTypes, methodParamTypes)
    : types.isSameTypes(paramTypes, methodParamTypes);
}

代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac

@Override
public Type visitClassType(ClassType t, Void ignored) {
  if (t.supertype_field == null) {
    Type supertype = ((ClassSymbol)t.tsym).getSuperclass();
    // An interface has no superclass; its supertype is Object.
    if (t.isInterface())
      supertype = ((ClassType)t.tsym.type).supertype_field;
    if (t.supertype_field == null) {
      List<Type> actuals = classBound(t).allparams();
      List<Type> formals = t.tsym.type.allparams();
      if (t.hasErasedSupertypes()) {
        t.supertype_field = erasureRecursive(supertype);
      } else if (formals.nonEmpty()) {
        t.supertype_field = subst(supertype, formals, actuals);
      }
      else {
        t.supertype_field = supertype;
      }
    }
  }
  return t.supertype_field;
}

代码示例来源:origin: konsoletyper/teavm-javac

@Override
public Type visitClassType(ClassType t, Void ignored) {
  if (t.supertype_field == null) {
    Type supertype = ((ClassSymbol)t.tsym).getSuperclass();
    // An interface has no superclass; its supertype is Object.
    if (t.isInterface())
      supertype = ((ClassType)t.tsym.type).supertype_field;
    if (t.supertype_field == null) {
      List<Type> actuals = classBound(t).allparams();
      List<Type> formals = t.tsym.type.allparams();
      if (t.hasErasedSupertypes()) {
        t.supertype_field = erasureRecursive(supertype);
      } else if (formals.nonEmpty()) {
        t.supertype_field = subst(supertype, formals, actuals);
      }
      else {
        t.supertype_field = supertype;
      }
    }
  }
  return t.supertype_field;
}

代码示例来源:origin: konsoletyper/teavm-javac

List<Type> formals = t.tsym.type.allparams();
if (t.hasErasedSupertypes()) {
  t.interfaces_field = erasureRecursive(interfaces);
} else if (formals.nonEmpty()) {
  t.interfaces_field = subst(interfaces, formals, actuals);

代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac

List<Type> formals = t.tsym.type.allparams();
if (t.hasErasedSupertypes()) {
  t.interfaces_field = erasureRecursive(interfaces);
} else if (formals.nonEmpty()) {
  t.interfaces_field =

相关文章

Types类方法