/** Derived visitor method: attribute a type tree. */ public Type attribType(JCTree tree, Env<AttrContext> env) { Type result = attribType(tree, env, Type.noType); return result; }
Type attribImportType(JCTree tree, Env<AttrContext> env) { assert completionEnabled; try { // To prevent deep recursion, suppress completion of some // types. completionEnabled = false; return attr.attribType(tree, env); } finally { completionEnabled = true; } }
Type attribImportType(JCTree tree, Env<AttrContext> env) { assert completionEnabled; try { // To prevent deep recursion, suppress completion of some // types. completionEnabled = false; return attr.attribType(tree, env); } finally { completionEnabled = true; } }
/** * Attribute the type references in a list of annotations. */ void attribAnnotationTypes(List<JCAnnotation> annotations, Env<AttrContext> env) { for (List<JCAnnotation> al = annotations; al.nonEmpty(); al = al.tail) { JCAnnotation a = al.head; attribType(a.annotationType, env); } }
/** * Attribute the type references in a list of annotations. */ void attribAnnotationTypes(List<JCAnnotation> annotations, Env<AttrContext> env) { for (List<JCAnnotation> al = annotations; al.nonEmpty(); al = al.tail) { JCAnnotation a = al.head; attribType(a.annotationType, env); } }
Type attribImportType(JCTree tree, Env<AttrContext> env) { Assert.check(completionEnabled); try { // To prevent deep recursion, suppress completion of some // types. completionEnabled = false; return attr.attribType(tree, env); } finally { completionEnabled = true; } }
Type attribImportType(JCTree tree, Env<AttrContext> env) { Assert.check(completionEnabled); try { // To prevent deep recursion, suppress completion of some // types. completionEnabled = false; return attr.attribType(tree, env); } finally { completionEnabled = true; } }
public void visitTypeArray(JCArrayTypeTree tree) { Type etype = attribType(tree.elemtype, env); Type type = new ArrayType(etype, syms.arrayClass); result = check(tree, type, TYP, resultInfo); }
public void visitTypeArray(JCArrayTypeTree tree) { Type etype = attribType(tree.elemtype, env); Type type = new ArrayType(etype, syms.arrayClass); result = check(tree, type, TYP, pkind, pt); }
public void visitAnnotatedType(JCAnnotatedType tree) { Type underlyingType = attribType(tree.getUnderlyingType(), env); this.attribAnnotationTypes(tree.annotations, env); annotateType(tree, tree.annotations); result = tree.type = underlyingType; }
public void visitAnnotatedType(JCAnnotatedType tree) { Type underlyingType = attribType(tree.getUnderlyingType(), env); this.attribAnnotationTypes(tree.annotations, env); annotateType(tree, tree.annotations); result = tree.type = underlyingType; }
public void visitWildcard(JCWildcard tree) { //- System.err.println("visitWildcard("+tree+");");//DEBUG Type type = (tree.kind.kind == BoundKind.UNBOUND) ? syms.objectType : attribType(tree.inner, env); result = check(tree, new WildcardType(chk.checkRefType(tree.pos(), type), tree.kind.kind, syms.boundClass), TYP, pkind, pt); }
public void visitWildcard(JCWildcard tree) { //- System.err.println("visitWildcard("+tree+");");//DEBUG Type type = (tree.kind.kind == BoundKind.UNBOUND) ? syms.objectType : attribType(tree.inner, env); result = check(tree, new WildcardType(chk.checkRefType(tree.pos(), type), tree.kind.kind, syms.boundClass), TYP, resultInfo); }
/** Attribute a type argument list, returning a list of types. * Caller is responsible for calling checkRefTypes. */ List<Type> attribAnyTypes(List<JCExpression> trees, Env<AttrContext> env) { ListBuffer<Type> argtypes = new ListBuffer<Type>(); for (List<JCExpression> l = trees; l.nonEmpty(); l = l.tail) argtypes.append(attribType(l.head, env)); return argtypes.toList(); }
/** Attribute a type argument list, returning a list of types. */ List<Type> attribTypes(List<JCExpression> trees, Env<AttrContext> env) { ListBuffer<Type> argtypes = new ListBuffer<Type>(); for (List<JCExpression> l = trees; l.nonEmpty(); l = l.tail) argtypes.append(chk.checkRefType(l.head.pos(), attribType(l.head, env))); return argtypes.toList(); }
/** Attribute a type argument list, returning a list of types. */ List<Type> attribTypes(List<JCExpression> trees, Env<AttrContext> env) { ListBuffer<Type> argtypes = new ListBuffer<Type>(); for (List<JCExpression> l = trees; l.nonEmpty(); l = l.tail) argtypes.append(chk.checkRefType(l.head.pos(), attribType(l.head, env))); return argtypes.toList(); }
public void visitTypeCast(JCTypeCast tree) { Type clazztype = attribType(tree.clazz, env); Type exprtype = attribExpr(tree.expr, env, Infer.anyPoly); Type owntype = chk.checkCastable(tree.expr.pos(), exprtype, clazztype); if (exprtype.constValue() != null) owntype = cfolder.coerce(exprtype, owntype); result = check(tree, capture(owntype), VAL, pkind, pt); }
public void visitTypeCast(JCTypeCast tree) { Type clazztype = attribType(tree.clazz, env); Type exprtype = attribExpr(tree.expr, env, Infer.anyPoly); Type owntype = chk.checkCastable(tree.expr.pos(), exprtype, clazztype); if (exprtype.constValue() != null) owntype = cfolder.coerce(exprtype, owntype); result = check(tree, capture(owntype), VAL, pkind, pt); }
public void visitTypeTest(JCInstanceOf tree) { Type exprtype = chk.checkNullOrRefType( tree.expr.pos(), attribExpr(tree.expr, env)); Type clazztype = chk.checkReifiableReferenceType( tree.clazz.pos(), attribType(tree.clazz, env)); chk.checkCastable(tree.expr.pos(), exprtype, clazztype); result = check(tree, syms.booleanType, VAL, pkind, pt); }
public void visitTypeTest(JCInstanceOf tree) { Type exprtype = chk.checkNullOrRefType( tree.expr.pos(), attribExpr(tree.expr, env)); Type clazztype = chk.checkReifiableReferenceType( tree.clazz.pos(), attribType(tree.clazz, env)); chk.checkCastable(tree.expr.pos(), exprtype, clazztype); result = check(tree, syms.booleanType, VAL, pkind, pt); }