Search in sources :

Example 1 with IntersectionTypeTree

use of com.sun.source.tree.IntersectionTypeTree in project checker-framework by typetools.

the class TypeFromTypeTreeVisitor method visitIntersectionType.

@Override
public AnnotatedTypeMirror visitIntersectionType(IntersectionTypeTree node, AnnotatedTypeFactory f) {
    // This method is only called for IntersectionTypes in casts.  There is no IntersectionTypeTree
    // for a type variable bound that is an intersection.  See #visitTypeParameter.
    AnnotatedIntersectionType type = (AnnotatedIntersectionType) f.type(node);
    List<AnnotatedTypeMirror> bounds = CollectionsPlume.mapList((Tree boundTree) -> visit(boundTree, f), node.getBounds());
    type.setBounds(bounds);
    type.copyIntersectionBoundAnnotations();
    return type;
}
Also used : AnnotatedIntersectionType(org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedIntersectionType) ArrayTypeTree(com.sun.source.tree.ArrayTypeTree) MethodTree(com.sun.source.tree.MethodTree) AnnotatedTypeTree(com.sun.source.tree.AnnotatedTypeTree) TypeParameterTree(com.sun.source.tree.TypeParameterTree) ParameterizedTypeTree(com.sun.source.tree.ParameterizedTypeTree) IdentifierTree(com.sun.source.tree.IdentifierTree) Tree(com.sun.source.tree.Tree) ClassTree(com.sun.source.tree.ClassTree) ExpressionTree(com.sun.source.tree.ExpressionTree) MemberSelectTree(com.sun.source.tree.MemberSelectTree) PrimitiveTypeTree(com.sun.source.tree.PrimitiveTypeTree) IntersectionTypeTree(com.sun.source.tree.IntersectionTypeTree) WildcardTree(com.sun.source.tree.WildcardTree) UnionTypeTree(com.sun.source.tree.UnionTypeTree)

Aggregations

AnnotatedTypeTree (com.sun.source.tree.AnnotatedTypeTree)1 ArrayTypeTree (com.sun.source.tree.ArrayTypeTree)1 ClassTree (com.sun.source.tree.ClassTree)1 ExpressionTree (com.sun.source.tree.ExpressionTree)1 IdentifierTree (com.sun.source.tree.IdentifierTree)1 IntersectionTypeTree (com.sun.source.tree.IntersectionTypeTree)1 MemberSelectTree (com.sun.source.tree.MemberSelectTree)1 MethodTree (com.sun.source.tree.MethodTree)1 ParameterizedTypeTree (com.sun.source.tree.ParameterizedTypeTree)1 PrimitiveTypeTree (com.sun.source.tree.PrimitiveTypeTree)1 Tree (com.sun.source.tree.Tree)1 TypeParameterTree (com.sun.source.tree.TypeParameterTree)1 UnionTypeTree (com.sun.source.tree.UnionTypeTree)1 WildcardTree (com.sun.source.tree.WildcardTree)1 AnnotatedIntersectionType (org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedIntersectionType)1