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

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

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

Types.isDirectSuperInterface介绍

暂无

代码示例

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

@Override
public void visitSelect(JCFieldAccess tree) {
  super.visitSelect(tree);
  if (tree.selected.type != null && (tree.name == names._this || (tree.name == names._super && !types.isDirectSuperInterface(tree.selected.type.tsym, currentClass))))
    checkThis(tree.pos(), tree.selected.type.tsym);
}

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

public void visitSelect(JCFieldAccess tree) {
  // need to special case-access of the form C.super.x
  // these will always need an access method, unless C
  // is a default interface subclassed by the current class.
  boolean qualifiedSuperAccess =
    tree.selected.hasTag(SELECT) &&
    TreeInfo.name(tree.selected) == names._super &&
    !types.isDirectSuperInterface(((JCFieldAccess)tree.selected).selected.type.tsym, currentClass);
  tree.selected = translate(tree.selected);
  if (tree.name == names._class) {
    result = classOf(tree.selected);
  }
  else if (tree.name == names._super &&
      types.isDirectSuperInterface(tree.selected.type.tsym, currentClass)) {
    //default super call!! Not a classic qualified super call
    TypeSymbol supSym = tree.selected.type.tsym;
    Assert.checkNonNull(types.asSuper(currentClass.type, supSym));
    result = tree;
  }
  else if (tree.name == names._this || tree.name == names._super) {
    result = makeThis(tree.pos(), tree.selected.type.tsym);
  }
  else
    result = access(tree.sym, tree, enclOp, qualifiedSuperAccess);
}

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

public void visitSelect(JCFieldAccess tree) {
  // need to special case-access of the form C.super.x
  // these will always need an access method, unless C
  // is a default interface subclassed by the current class.
  boolean qualifiedSuperAccess =
    tree.selected.hasTag(SELECT) &&
    TreeInfo.name(tree.selected) == names._super &&
    !types.isDirectSuperInterface(((JCFieldAccess)tree.selected).selected.type.tsym, currentClass);
  tree.selected = translate(tree.selected);
  if (tree.name == names._class) {
    result = classOf(tree.selected);
  }
  else if (tree.name == names._super &&
      types.isDirectSuperInterface(tree.selected.type.tsym, currentClass)) {
    //default super call!! Not a classic qualified super call
    TypeSymbol supSym = tree.selected.type.tsym;
    Assert.checkNonNull(types.asSuper(currentClass.type, supSym));
    result = tree;
  }
  else if (tree.name == names._this || tree.name == names._super) {
    result = makeThis(tree.pos(), tree.selected.type.tsym);
  }
  else
    result = access(tree.sym, tree, enclOp, qualifiedSuperAccess);
}

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

types.isDirectSuperInterface(c, env.enclClass.sym)) {

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

types.isDirectSuperInterface(c, env.enclClass.sym)) {

相关文章

Types类方法