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

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

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

Types.substBound介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-source-base

public static boolean checkTypesAssignable(CompilationInfo info, TypeMirror from, TypeMirror to) {
  Context c = ((JavacTaskImpl) info.impl.getJavacTask()).getContext();
  if (from.getKind() == TypeKind.TYPEVAR) {
    Types types = Types.instance(c);
    TypeVar t = types.substBound((TypeVar)from, com.sun.tools.javac.util.List.of((Type)from), com.sun.tools.javac.util.List.of(types.boxedTypeOrType((Type)to)));
    return info.getTypes().isAssignable(t.getUpperBound(), to)
        || info.getTypes().isAssignable(to, t.getUpperBound());
  }
  if (from.getKind() == TypeKind.WILDCARD) {
    from = Types.instance(c).wildUpperBound((Type)from);
  }
  return Check.instance(c).checkType(null, (Type)from, (Type)to).getKind() != TypeKind.ERROR;
}

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

if (tvars.tail.isEmpty())
  return List.<Type>of(substBound((TypeVar)tvars.head, from, to));
ListBuffer<Type> newBoundsBuf = lb();
boolean changed = false;

代码示例来源:origin: sc.fiji/javac

if (tvars.tail.isEmpty())
  return List.<Type>of(substBound((TypeVar)tvars.head, from, to));
ListBuffer<Type> newBoundsBuf = lb();
boolean changed = false;

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

tvars_buf.append(types.substBound(((TypeVar)forms.head),
         formals,
         Type.removeBounds(actuals)));

代码示例来源:origin: sc.fiji/javac

tvars_buf.append(types.substBound(((TypeVar)forms.head),
                 formals,
                 Type.removeBounds(actuals)));

相关文章

Types类方法