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

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

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

Types.capture介绍

[英]Capture conversion as specified by JLS 3rd Ed.
[中]JLS第三版规定的捕获转换。

代码示例

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

private Type capture(Type type) {
    return types.capture(type);
  }
}

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

private Type capture(Type type) {
    return types.capture(type);
  }
}

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

private Type capture(Type type) {
  return types.capture(type);
}

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

private Type capture(Type type) {
  return types.capture(type);
}

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

Type cachedCapture(JCTree tree, Type t, boolean readOnly) {
    Type captured = captureTypeCache.get(tree);
    if (captured != null) {
      return captured;
    }
    Type result = types.capture(t);
    if (result != t && !readOnly) { // then t is a wildcard parameterized type
      captureTypeCache.put(tree, result);
    }
    return result;
  }
}

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

public boolean checkCompatibleAbstracts(DiagnosticPosition pos,
                    Type t1,
                    Type t2,
                    Type site) {
  if ((site.tsym.flags() & COMPOUND) != 0) {
    // special case for intersections: need to eliminate wildcards in supertypes
    t1 = types.capture(t1);
    t2 = types.capture(t2);
  }
  return firstIncompatibility(pos, t1, t2, site) == null;
}

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

public TypeMirror capture(TypeMirror t) {
  validateTypeNotIn(t, EXEC_OR_PKG);
  return types.capture((Type) t);
}

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

public TypeMirror capture(TypeMirror t) {
  validateTypeNotIn(t, EXEC_OR_PKG);
  return types.capture((Type) t);
}

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

public TypeMirror capture(TypeMirror t) {
  validateTypeNotIn(t, EXEC_OR_PKG);
  return types.capture((Type) t);
}

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

public TypeMirror capture(TypeMirror t) {
validateTypeNotIn(t, EXEC_OR_PKG);
return types.capture((Type) t);
}

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

public boolean isSubtype(Type t, Type s, boolean capture) {
  if (t == s)
    return true;
  if (s.tag >= firstPartialTag)
    return isSuperType(s, t);
  Type lower = lowerBound(s);
  if (s != lower)
    return isSubtype(capture ? capture(t) : t, lower, false);
  return isSubtype.visit(capture ? capture(t) : t, s);
}
// where

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

/**
 * Capture conversion as specified by the JLS.
 */
public List<Type> capture(List<Type> ts) {
  List<Type> buf = List.nil();
  for (Type t : ts) {
    buf = buf.prepend(capture(t));
  }
  return buf.reverse();
}

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

/**
 * Capture conversion as specified by the JLS.
 */
public List<Type> capture(List<Type> ts) {
  List<Type> buf = List.nil();
  for (Type t : ts) {
    buf = buf.prepend(capture(t));
  }
  return buf.reverse();
}
public Type capture(Type t) {

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

/**
 * Capture conversion as specified by JLS 3rd Ed.
 */
public List<Type> capture(List<Type> ts) {
  List<Type> buf = List.nil();
  for (Type t : ts) {
    buf = buf.prepend(capture(t));
  }
  return buf.reverse();
}
public Type capture(Type t) {

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

UnboundMethodReferenceLookupHelper(JCMemberReference referenceTree, Name name, Type site,
    List<Type> argtypes, List<Type> typeargtypes, MethodResolutionPhase maxPhase) {
  super(referenceTree, name, site, argtypes.tail, typeargtypes, maxPhase);
  if (site.isRaw() && !argtypes.head.hasTag(NONE)) {
    Type asSuperSite = types.asSuper(argtypes.head, site.tsym);
    this.site = types.capture(asSuperSite);
  }
}

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

public boolean isSubtype(Type t, Type s, boolean capture) {
  if (t == s)
    return true;
  if (s.tag >= firstPartialTag)
    return isSuperType(s, t);
  if (s.isCompound()) {
    for (Type s2 : interfaces(s).prepend(supertype(s))) {
      if (!isSubtype(t, s2, capture))
        return false;
    }
    return true;
  }
  Type lower = lowerBound(s);
  if (s != lower)
    return isSubtype(capture ? capture(t) : t, lower, false);
  return isSubtype.visit(capture ? capture(t) : t, s);
}
// where

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

@Override
protected Type check(DiagnosticPosition pos, Type found) {
  if (found.hasTag(DEFERRED)) {
    DeferredType dt = (DeferredType)found;
    return dt.check(this);
  } else {
    return super.check(pos, chk.checkNonVoid(pos, types.capture(U(found.baseType()))));
  }
}

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

Symbol getMemberReference(DiagnosticPosition pos,
    Env<AttrContext> env,
    JCMemberReference referenceTree,
    Type site,
    Name name) {
  site = types.capture(site);
  ReferenceLookupHelper lookupHelper = makeReferenceLookupHelper(
      referenceTree, site, name, List.<Type>nil(), null, VARARITY);
  Env<AttrContext> newEnv = env.dup(env.tree, env.info.dup());
  Symbol sym = lookupMethod(newEnv, env.tree.pos(), site.tsym,
      nilMethodCheck, lookupHelper);
  env.info.pendingResolutionPhase = newEnv.info.pendingResolutionPhase;
  return sym;
}

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

Symbol getMemberReference(DiagnosticPosition pos,
    Env<AttrContext> env,
    JCMemberReference referenceTree,
    Type site,
    Name name) {
  site = types.capture(site);
  ReferenceLookupHelper lookupHelper = makeReferenceLookupHelper(
      referenceTree, site, name, List.<Type>nil(), null, VARARITY);
  Env<AttrContext> newEnv = env.dup(env.tree, env.info.dup());
  Symbol sym = lookupMethod(newEnv, env.tree.pos(), site.tsym,
      nilMethodCheck, lookupHelper);
  env.info.pendingResolutionPhase = newEnv.info.pendingResolutionPhase;
  return sym;
}

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

@Override
protected Type check(DiagnosticPosition pos, Type found) {
  if (found.hasTag(DEFERRED)) {
    DeferredType dt = (DeferredType)found;
    return dt.check(this);
  } else {
    Type uResult = U(found);
    Type capturedType = pos == null || pos.getTree() == null ?
        types.capture(uResult) :
        checkContext.inferenceContext()
          .cachedCapture(pos.getTree(), uResult, true);
    return super.check(pos, chk.checkNonVoid(pos, capturedType));
  }
}

相关文章

Types类方法