Search in sources :

Example 1 with MemberOrTypeExpression

use of com.redhat.ceylon.compiler.typechecker.tree.Tree.MemberOrTypeExpression in project ceylon-compiler by ceylon.

the class BoxingVisitor method visit.

@Override
public void visit(Expression that) {
    Stack<Boolean> npebs = setPEB();
    super.visit(that);
    resetPEB(npebs);
    Term term = that.getTerm();
    propagateFromTerm(that, term);
    // which will need to be marked boxed
    if (term instanceof MemberOrTypeExpression) {
        Tree.MemberOrTypeExpression expr = (Tree.MemberOrTypeExpression) term;
        if (expr.getDeclaration() instanceof Function) {
            that.setUnboxed(false);
        }
    }
}
Also used : Function(com.redhat.ceylon.model.typechecker.model.Function) MemberOrTypeExpression(com.redhat.ceylon.compiler.typechecker.tree.Tree.MemberOrTypeExpression) Tree(com.redhat.ceylon.compiler.typechecker.tree.Tree) TreeUtil.unwrapExpressionUntilTerm(com.redhat.ceylon.compiler.typechecker.tree.TreeUtil.unwrapExpressionUntilTerm) Term(com.redhat.ceylon.compiler.typechecker.tree.Tree.Term) MemberOrTypeExpression(com.redhat.ceylon.compiler.typechecker.tree.Tree.MemberOrTypeExpression) StaticMemberOrTypeExpression(com.redhat.ceylon.compiler.typechecker.tree.Tree.StaticMemberOrTypeExpression)

Aggregations

Tree (com.redhat.ceylon.compiler.typechecker.tree.Tree)1 MemberOrTypeExpression (com.redhat.ceylon.compiler.typechecker.tree.Tree.MemberOrTypeExpression)1 StaticMemberOrTypeExpression (com.redhat.ceylon.compiler.typechecker.tree.Tree.StaticMemberOrTypeExpression)1 Term (com.redhat.ceylon.compiler.typechecker.tree.Tree.Term)1 TreeUtil.unwrapExpressionUntilTerm (com.redhat.ceylon.compiler.typechecker.tree.TreeUtil.unwrapExpressionUntilTerm)1 Function (com.redhat.ceylon.model.typechecker.model.Function)1