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

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


        Class c = that.getDeclarationModel();
        if (c.isAnnotation()) {
            checkAnnotationType(that, c);
        }
       
        TypeDeclaration dm = that.getDeclarationModel();
        Unit unit = that.getUnit();
        checkAnnotations(that.getAnnotationList(),
                unit.getClassDeclarationType(),
                unit.getClassMetatype(dm.getType()));
    }
View Full Code Here


    }

    @Override
    public void visit(Tree.AnyInterface that) {
        super.visit(that);
        TypeDeclaration dm = that.getDeclarationModel();
        Unit unit = that.getUnit();
        checkAnnotations(that.getAnnotationList(),
                unit.getInterfaceDeclarationType(),
                unit.getInterfaceMetatype(dm.getType()));
    }
View Full Code Here

        Tree.Type type = that.getType();
        if (type!=null) {
            ProducedType t = type.getTypeModel();
            if (t!=null && t.getDeclaration()!=null) {
                if (t.getDeclaration().isAnnotation()) {
                    TypeDeclaration annotationDec = that.getUnit().getAnnotationDeclaration();
                    if (t.getDeclaration() instanceof NothingType) {
                        that.addError("annotation constructor may not return 'Nothing'");
                    }
                    if (!t.getDeclaration().inherits(annotationDec)) {
                        that.addError("annotation constructor must return a subtype of 'Annotation'");
View Full Code Here

                    !declaredInPackage(root, that.getUnit())) {
                that.addError("refined declaration is not visible: " +
                        message(root));
            }
            boolean found = false;
            TypeDeclaration rootType = (TypeDeclaration) root.getContainer();
            for (Declaration refined:
                    getInterveningRefinements(dec.getName(),
                            signature, root, type, rootType)) {
                if (isOverloadedVersion(refined)) {
                    //if this member is overloaded, the
View Full Code Here

        }
    }
    @Override
    public void visit(Tree.SimpleType that) {
      super.visit(that);
        TypeDeclaration d = that.getDeclarationModel();
    if (d!=null && d.isDeprecated()) {
        that.addUsageWarning(Warning.deprecation,
                    "type is deprecated: '" +
                        d.getName() + "'");
        }
    }
View Full Code Here

    }
   
    @Override
    public void visit(Tree.SimpleType that) {
        super.visit(that);
        TypeDeclaration t = that.getDeclarationModel();
        if (t!=null &&
            !(t instanceof UnionType) &&
            !(t instanceof IntersectionType)) {
          referenced(t);
        }
View Full Code Here

            if (pt.getDeclaration().equals(unit.getIterableDeclaration())) {
                ProducedType et = unit.getIteratedType(pt);
                if (et!=null && pt.getTypeArgumentList().size()==2) {
                    ProducedType at = pt.getTypeArgumentList().get(1);
                    if (at!=null) {
                        TypeDeclaration d = at.getDeclaration();
                        return d instanceof NothingType ||
                                d instanceof ClassOrInterface &&
                                d.equals(unit.getNullDeclaration());
                    }
                }// && et.isPrimitiveAbbreviatedType();
            }
        }
        return false;
View Full Code Here

            Unit u = args.getDeclaration().getUnit();
            boolean defaulted=false;
            if (args.getDeclaration() instanceof UnionType) {
                List<ProducedType> cts = args.getDeclaration().getCaseTypes();
                if (cts.size()==2) {
                    TypeDeclaration lc = cts.get(0).getDeclaration();
                    if (lc instanceof Interface &&
                            lc.equals(u.getEmptyDeclaration())) {
                        args = cts.get(1);
                        defaulted = true;
                    }
                    TypeDeclaration rc = cts.get(1).getDeclaration();
                    if (lc instanceof Interface &&
                            rc.equals(u.getEmptyDeclaration())) {
                        args = cts.get(0);
                        defaulted = true;
                    }
                }
            }
View Full Code Here

        boolean fullyQualified = printFullyQualified();
        if (printQualifyingType()) {
            ProducedType qt = pt.getQualifyingType();
            if (qt != null) {
              TypeDeclaration qtd = qt.getDeclaration();
        if (qtd instanceof IntersectionType ||
          qtd instanceof UnionType) {
          ptn.append(lt());
              }
                ptn.append(getProducedTypeName(qt, unit));
View Full Code Here

    @Override
    public void visit(Tree.ExtendedType that) {
        inExtends = true;
        super.visit(that);
        inExtends = false;
        TypeDeclaration td = (TypeDeclaration) that.getScope();
        if (td.isAlias()) {
            return;
        }
        if (that.getType()==null) {
            that.addError("missing extended type");
        }
        else if (that.getInvocationExpression()==null) {
            that.addError("missing instantiation arguments");
        }
        else {
            ProducedType type = that.getType().getTypeModel();
            if (type!=null) {
                td.setExtendedType(type);
            }
        }
    }
View Full Code Here

TOP

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

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.