Package com.redhat.ceylon.compiler.typechecker.model

Examples of com.redhat.ceylon.compiler.typechecker.model.LazyProducedType


        c.addMember(v);
        that.setRefinement(true);
        that.setDeclaration(v);
        that.setRefined(sv);
        that.getUnit().addDeclaration(v);
        v.setType(new LazyProducedType(that.getUnit()) {
            @Override
            public Map<TypeParameter, ProducedType> initTypeArguments() {
                return rv.getType().getTypeArguments();
            }
            @Override
View Full Code Here


                    v.setName(p.getName());
                    vp.setDeclaration(m);
                    v.setContainer(m);
                    v.setScope(m);
                    l.getParameters().add(vp);
                    v.setType(new LazyProducedType(that.getUnit()) {
                        @Override
                        public Map<TypeParameter, ProducedType> initTypeArguments() {
                            return rm.getTypedParameter(p).getFullType()
                                    .getTypeArguments();
                        }
                        @Override
                        public TypeDeclaration initDeclaration() {
                            return rm.getTypedParameter(p).getFullType()
                                    .getDeclaration();
                        }
                    });
                }
                else {
                    Tree.Parameter tp = tpl.getParameters().get(j);
                    Parameter rp = tp.getParameterModel();
                    rp.setDefaulted(p.isDefaulted());
                    rp.setDeclaration(m);
                    l.getParameters().add(rp);
                }
                j++;
            }
            m.getParameterLists().add(l);
        }
        if (!sm.getTypeParameters().isEmpty()) {
            bme.addError("method has type parameters: "
                    message(sm));
        }
        m.setShared(true);
        m.setActual(true);
        m.getAnnotations().add(new Annotation("shared"));
        m.getAnnotations().add(new Annotation("actual"));
        m.setRefinedDeclaration(sm.getRefinedDeclaration()); //Note: this is not the real root, so we set it again in ExpressionVisitor
        m.setUnit(that.getUnit());
        m.setContainer(c);
        m.setShortcutRefinement(true);
        m.setDeclaredVoid(sm.isDeclaredVoid());
        setVisibleScope(m);
        c.addMember(m);
        that.setRefinement(true);
        that.setDeclaration(m);
        that.setRefined(sm);
        that.getUnit().addDeclaration(m);
        if (that.getScope() instanceof Specification){
            ((Specification) that.getScope()).setDeclaration(m);
        }
        m.setType(new LazyProducedType(that.getUnit()) {
            @Override
            public Map<TypeParameter, ProducedType> initTypeArguments() {
                return rm.getType().getTypeArguments();
            }
            @Override
View Full Code Here

        ((Generic) declaration).setTypeParameters(getTypeParameters(that));
    }   
       
    private void defaultExtendedToBasic(Class c) {
        //default supertype for classes
        c.setExtendedType(new LazyProducedType(unit) {
            @Override
            public Map<TypeParameter, ProducedType> initTypeArguments() {
                return emptyMap();
            }
            @Override
View Full Code Here

        });
    }

    private void defaultExtendedToObject(Interface c) {
        //default supertype for interfaces
        c.setExtendedType(new LazyProducedType(unit) {
            @Override
            public Map<TypeParameter, ProducedType> initTypeArguments() {
                return emptyMap();
            }
            @Override
View Full Code Here

        });
    }

    private void defaultExtendedToAnything(TypeParameter c) {
        //default supertype for interfaces
        c.setExtendedType(new LazyProducedType(unit) {
            @Override
            public Map<TypeParameter, ProducedType> initTypeArguments() {
                return emptyMap();
            }
            @Override
View Full Code Here

    public void visit(final Tree.BaseType that) {
        super.visit(that);
        final Scope scope = that.getScope();
        final String name = name(that.getIdentifier());
        if (inExtends) {
            ProducedType t = new LazyProducedType(unit) {
                @Override
                public TypeDeclaration initDeclaration() {
                    return getTypeDeclaration(scope,
                            name, null, false, unit);
                }
View Full Code Here

    public void visit(final Tree.QualifiedType that) {
        super.visit(that);
        final String name = name(that.getIdentifier());
        final ProducedType outerType = that.getOuterType().getTypeModel();
        if (inExtends) {
            ProducedType t = new LazyProducedType(unit) {
                @Override
                public TypeDeclaration initDeclaration() {
                    if (outerType==null) {
                        return null;
                    }
View Full Code Here

            }
            else {
              elementType = null;
              atLeastOne = false;
            }
            ProducedType t = new LazyProducedType(unit) {
                ProducedType iterableType() {
                    if (elementType!=null) {
                        return atLeastOne ?
                                unit.getNonemptyIterableType(elementType) :
                                unit.getIterableType(elementType);
View Full Code Here

    }
   
    public void visit(final Tree.TupleType that) {
        super.visit(that);
        if (inExtends) {
            ProducedType t = new LazyProducedType(unit) {
                private ProducedType tupleType(final Tree.TupleType that) {
                    //TODO: this holds a hard reference to the Tree.Type
                    return getTupleType(that.getElementTypes(), unit);
                }
                @Override
View Full Code Here

   
    public void visit(final Tree.OptionalType that) {
        super.visit(that);
        final ProducedType definiteType = that.getDefiniteType().getTypeModel();
        if (inExtends) {
            ProducedType t = new LazyProducedType(unit) {
                @Override
                public TypeDeclaration initDeclaration() {
                    List<ProducedType> types =
                            new ArrayList<ProducedType>(2);
                    types.add(unit.getType(unit.getNullDeclaration()));
View Full Code Here

TOP

Related Classes of com.redhat.ceylon.compiler.typechecker.model.LazyProducedType

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.