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

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


    }
   
    @Override
    public void visit(Tree.AnyAttribute that) {
        super.visit(that);
        TypedDeclaration dm = that.getDeclarationModel();
        Unit unit = that.getUnit();
        checkAnnotations(that.getAnnotationList(),
                unit.getValueDeclarationType(dm),
                unit.getValueMetatype(dm.getTypedReference()));
    }
View Full Code Here


        Method a = that.getDeclarationModel();
        if (a.isAnnotation()) {
            checkAnnotationConstructor(that, a);
        }
       
        TypedDeclaration dm = that.getDeclarationModel();
        Unit unit = that.getUnit();
        checkAnnotations(that.getAnnotationList(),
                unit.getFunctionDeclarationType(),
                unit.getFunctionMetatype(dm.getTypedReference()));
    }
View Full Code Here

    }

    @Override
    public void visit(Tree.TypedDeclaration that) {
        super.visit(that);
        TypedDeclaration dec = that.getDeclarationModel();
        setType(that, that.getType(), dec);
        if (dec instanceof MethodOrValue) {
            if (dec.isLate() && ((MethodOrValue) dec).isParameter()) {
                that.addError("parameter may not be annotated late");
            }
        }
    }
View Full Code Here

            }
        }
        else {
            for (Tree.BaseMemberExpression bme: bmes) {
                //bmes have not yet been resolved
                TypedDeclaration od = getTypedDeclaration(bme.getScope(),
                        name(bme.getIdentifier()), null, false, bme.getUnit());
                if (od!=null) {
                    ProducedType type = od.getType();
                    if (type!=null) {
                        list.add(type);
                    }
                }
            }
View Full Code Here

        if (expr != null) {
            boolean prevNoExpressionlessReturn = noExpressionlessReturn;
            try {
                noExpressionlessReturn = false;
                // we can cast to TypedDeclaration here because return with expressions are only in Method or Value
                TypedDeclaration declaration = (TypedDeclaration)ret.getDeclaration();
                returnExpr = expressionGen().transformExpression(declaration, expr.getTerm());
                // make sure all returns from hash are properly turned into ints
                returnExpr = convertToIntIfHashAttribute(declaration, returnExpr);
            } finally {
                noExpressionlessReturn = prevNoExpressionlessReturn;
View Full Code Here

                } else {
                    first = false;
                }
               
                if( type instanceof TypedDeclaration ) {
                    TypedDeclaration decl = (TypedDeclaration) type;
                    linkRenderer().to(decl).write();
                } else if( type instanceof ClassOrInterface ) {
                    ClassOrInterface klass = (ClassOrInterface) type;
                    linkRenderer().to(klass).printAbbreviated(!isAbbreviatedType(klass)).write();
                } else {
View Full Code Here

        Declaration refined = CodegenUtil.getTopmostRefinedDeclaration(method, optimisedMethodSpecifiersToMethods);
        // deal with invalid input
        if(refined == null
                || (!(refined instanceof Method)))
            return;
        TypedDeclaration refinedMethod = (TypedDeclaration)refined;
        if (method.getName() != null) {
            // A Callable, which never have primitive parameters
            setBoxingState(method, refinedMethod);
        } else {
            // Anonymous methods are always boxed
View Full Code Here

            declaration.setUnboxed(true);
        } else if (Decl.isValueParameter(declaration)
                && CodegenUtil.isContainerFunctionalParameter(declaration)
                && Strategy.createMethod((MethodOrValue)declaration.getContainer())) {
            Method functionalParameter = (Method)declaration.getContainer();
            TypedDeclaration refinedFrom = (TypedDeclaration)CodegenUtil.getTopmostRefinedDeclaration(functionalParameter, optimisedMethodSpecifiersToMethods);
            if (Decl.equal(refinedFrom, functionalParameter) ) {
                // Don't consider Anything to be unboxed, since this is a parameter
                // note a method return type (where void would be considered unboxed).
                declaration.setUnboxed(!declaration.getUnit().getAnythingDeclaration().getType().isExactly(declaration.getType()));
            } else {
                // make sure refined declarations have already been set
                if(refinedFrom.getUnboxed() == null)
                    setBoxingState(refinedFrom, refinedFrom);
                // inherit
                declaration.setUnboxed(refinedFrom.getUnboxed());
            }
        } else {  
            declaration.setUnboxed(false);
        }
    }
View Full Code Here

    private void boxAttribute(TypedDeclaration declaration) {
        // deal with invalid input
        if(declaration == null)
            return;
        TypedDeclaration refinedDeclaration = null;
        refinedDeclaration = (TypedDeclaration)CodegenUtil.getTopmostRefinedDeclaration(declaration, optimisedMethodSpecifiersToMethods);
        // deal with invalid input
        if(refinedDeclaration == null)
            return;
        setBoxingState(declaration, refinedDeclaration);
View Full Code Here

    }
   
    @Override
    public void visit(Tree.Parameter that) {
        super.visit(that);
        TypedDeclaration declaration = that.getParameterModel().getModel();
        visitAttributeOrParameter(declaration);
    }
View Full Code Here

TOP

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

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.