Package com.redhat.ceylon.compiler.loader.mirror

Examples of com.redhat.ceylon.compiler.loader.mirror.TypeParameterMirror


                if(hasTypeParameterWithConstraints(ta))
                    return true;
            }
            return false;
        case TYPEVAR:
            TypeParameterMirror typeParameter = type.getTypeParameter();
            return typeParameter != null && hasNonErasedBounds(typeParameter);
        default:
            return false;
        }
    }
View Full Code Here


            else // must be a method
                scope.getMembers().add(param);
            param.setName((String)typeParamAnnotation.getValue("value"));
            param.setExtendedType(typeFactory.getAnythingDeclaration().getType());
            if(i < typeParameterMirrors.size()){
                TypeParameterMirror typeParameterMirror = typeParameterMirrors.get(i);
                param.setNonErasedBounds(hasNonErasedBounds(typeParameterMirror));
            }
           
            String varianceName = (String) typeParamAnnotation.getValue("variance");
            if(varianceName != null){
View Full Code Here

                            typeArgument = bound;
                        }
                    }
                    // if we have no type argument, or if it's a wildcard with no bound, use the type parameter bounds if we can
                    if(typeArgument == null && typeParameterMirrors != null && i < typeParameterMirrors.size()){
                        TypeParameterMirror typeParameterMirror = typeParameterMirrors.get(i);
                        // FIXME: multiple bounds?
                        if(typeParameterMirror.getBounds().size() == 1){
                            // make sure we don't go overboard
                            if(rawDeclarationsSeen == null){
                                rawDeclarationsSeen = new HashSet<TypeDeclaration>();
                                // detect recursive bounds that we can't possibly satisfy, such as Foo<T extends Foo<T>>
                                if(!rawDeclarationsSeen.add(declaration))
                                    throw new RecursiveTypeParameterBoundException();
                            }
                            TypeMirror bound = typeParameterMirror.getBounds().get(0);
                            try{
                                producedTypeArgument = obtainTypeParameterBound(moduleScope, bound, declaration, rawDeclarationsSeen);
                                siteVariance = SiteVariance.OUT;
                            }catch(RecursiveTypeParameterBoundException x){
                                // damnit, go for Object later
View Full Code Here

    }

    private ProducedType obtainTypeParameterBound(Module moduleScope, TypeMirror type, Scope scope, Set<TypeDeclaration> rawDeclarationsSeen) {
        // type variables are never mapped
        if(type.getKind() == TypeKind.TYPEVAR){
            TypeParameterMirror typeParameter = type.getTypeParameter();
            if(!typeParameter.getBounds().isEmpty()){
                IntersectionType it = new IntersectionType(getUnitForModule(moduleScope));
                for(TypeMirror bound : typeParameter.getBounds()){
                    ProducedType boundModel = obtainTypeParameterBound(moduleScope, bound, scope, rawDeclarationsSeen);
                    it.getSatisfiedTypes().add(boundModel);
                }
                return it.getType();
            }else
View Full Code Here

TOP

Related Classes of com.redhat.ceylon.compiler.loader.mirror.TypeParameterMirror

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.