Package com.redhat.ceylon.compiler.typechecker.tree

Examples of com.redhat.ceylon.compiler.typechecker.tree.Node.addError()


                if (e != null) {
                    ProducedType ot = unit.getType(unit.getObtainableDeclaration());
                    ProducedType dt = unit.getType(unit.getDestroyableDeclaration());
                    if (isInstantiationExpression(e)) {
                        if (!t.isSubtypeOf(dt) && !t.isSubtypeOf(ot)) {
                            typedNode.addError("resource must be either obtainable or destroyable: '" +
                                    t.getProducedTypeName(unit) + "' is neither 'Obtainable' nor 'Destroyable'");
                        }
                    }
                    else {
                        checkAssignable(t, ot, typedNode, "resource must be obtainable");
View Full Code Here


        }
        if (type instanceof Tree.LocalModifier) {
            if (isTypeUnknown(type.getTypeModel())) {
                if (se==null || !hasError(se)) {
                    Node node = type.getToken()==null ? that : type;
                    node.addError("argument type could not be inferred");
                }
            }
        }
    }
View Full Code Here

        }
        if (type instanceof Tree.LocalModifier) {
            if (isTypeUnknown(type.getTypeModel())) {
                if (se==null || hasError(type)) {
                    Node node = type.getToken()==null ? that : type;
                    node.addError("argument type could not be inferred");
                }
            }
        }
    }
View Full Code Here

        for (int i=0; i<params.size(); i++) {
            Parameter p = params.get(i);
            if (i>=args.size()) {
                if (!p.isDefaulted() && (!p.isSequenced() || p.isAtLeastOne())) {
                    Node n = that instanceof Tree.Annotation && args.isEmpty() ? that : pal;
                    n.addError("missing argument to required parameter '" +
                            p.getName() + "' of '" + pr.getDeclaration().getName(unit) + "'");
                }
            }
            else {
                Tree.PositionalArgument a = args.get(i);
View Full Code Here

                    getContainingClassOrInterface(that.getScope());
        if (that instanceof Tree.ClassLiteral ||
            that instanceof Tree.InterfaceLiteral) {
            d = classOrInterface;
            if (d==null) {
                errorNode.addError("no containing type");
                return; //EARLY EXIT!!
            }
            else {
                t = classOrInterface.getType();
            }
View Full Code Here

            else {
                t = classOrInterface.getType();
            }
        }
        else {
            errorNode.addError("missing type reference");
            return; //EARLY EXIT!!
        }
    }
        // FIXME: should we disallow type parameters in there?
        if (t!=null) {
View Full Code Here

            that.setDeclaration(d);
            that.setWantsDeclaration(true);
            if (that instanceof Tree.ClassLiteral) {
                if (!(d instanceof Class)) {
                    if (d != null) {
                        errorNode.addError("referenced declaration is not a class" +
                                getDeclarationReferenceSuggestion(d));
                    }
                }
                that.setTypeModel(unit.getClassDeclarationType());
            }
View Full Code Here

                that.setTypeModel(unit.getClassDeclarationType());
            }
            else if (that instanceof Tree.InterfaceLiteral) {
                if (!(d instanceof Interface)) {
                    if (d!=null) {
                        errorNode.addError("referenced declaration is not an interface" +
                                getDeclarationReferenceSuggestion(d));
                    }
                }
                that.setTypeModel(unit.getInterfaceDeclarationType());
            }
View Full Code Here

                }
                that.setTypeModel(unit.getInterfaceDeclarationType());
            }
            else if (that instanceof Tree.AliasLiteral) {
                if (!(d instanceof TypeAlias)) {
                    errorNode.addError("referenced declaration is not a type alias" +
                            getDeclarationReferenceSuggestion(d));
                }
                that.setTypeModel(unit.getAliasDeclarationType());
            }
            else if (that instanceof Tree.TypeParameterLiteral) {
View Full Code Here

                }
                that.setTypeModel(unit.getAliasDeclarationType());
            }
            else if (that instanceof Tree.TypeParameterLiteral) {
                if (!(d instanceof TypeParameter)) {
                    errorNode.addError("referenced declaration is not a type parameter" +
                            getDeclarationReferenceSuggestion(d));
                }
                that.setTypeModel(unit.getTypeParameterDeclarationType());
            }
            else if (d != null) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.