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

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


        if(type == null)
            return makeErroneous(null, "compiler bug: "+ type + " is not a java array");
        type = simplifyType(type);
        if(type == null || type.getDeclaration() instanceof Class == false)
            return makeErroneous(null, "compiler bug: " + type + " is not a java array");
        Class c = (Class) type.getDeclaration();
        String name = c.getQualifiedNameString();
        if(name.equals("java.lang::ObjectArray")){
            // fetch its type parameter
            if(type.getTypeArgumentList().size() != 1)
                return makeErroneous(null, "compiler bug: " + type + " is missing parameter type to java ObjectArray");
            ProducedType elementType = type.getTypeArgumentList().get(0);
View Full Code Here


            mod.setName(Arrays.asList(""));
            mod.setLanguageModule(new Module());
            pkg.setName(Arrays.asList(""));
            pkg.setModule(mod);
            unit.setPackage(pkg);
            Class a = makeClass("a");
            makeClass("b", a);
            makeClass("b");
            makeClass("c");
            makeClass("d");
            makeClass("e");
            makeClass("f");
            Class t2 = makeParameterisedClass("t2");
            makeParameterisedClass("t2", t2);
            Package otherPkg = new Package();
            otherPkg.setName(Arrays.asList("pkg"));
            makeClass("a", otherPkg);
            Class b = makeClass("b", otherPkg);
            makeClass("c", b);
        }
View Full Code Here

        }

       
        @Override
        public ProducedType getType(Module module, String pkg, String name, Scope scope) {
            Class klass = (Class)getDeclaration(module, pkg, name, scope);
            return klass.getType();
        }
View Full Code Here

            return klass.getType();
        }

        @Override
        public Declaration getDeclaration(Module module, String pkg, String name, Scope scope) {
            Class klass = classes.get(name);
            if(klass == null)
                throw new ModelResolutionException("Unknown type: "+name);
            return klass;
        }
View Full Code Here

        private Class makeParameterisedClass(String name) {
            return makeParameterisedClass(name, null);
        }
       
        private Class makeParameterisedClass(String name, Class container) {
            Class klass = makeClass(name, container);
            List<TypeParameter> typeParameters = new ArrayList<TypeParameter>(2);
            TypeParameter typeParam = new TypeParameter();
            typeParam.setName("A");
            typeParameters.add(typeParam);
            typeParam = new TypeParameter();
            typeParam.setName("B");
            typeParameters.add(typeParam);
            klass.setTypeParameters(typeParameters );
            return klass;
        }
View Full Code Here

        private Class makeClass(String name) {
            return makeClass(name, null);
        }
       
        private Class makeClass(String name, Scope container) {
            Class klass = new Class();
            klass.setName(name);
            klass.setUnit(unit);
            klass.setShared(true);
            if(container != null){
                container.addMember(klass);
                klass.setContainer(container);
                classes.put(container.getQualifiedNameString()+"."+name, klass);
            }else{
                klass.setContainer(pkg);
                classes .put(name, klass);
            }
            return klass;
        }
View Full Code Here

        if(extendedType != null){
            // FIXME: see above
            boolean lostTypeParameter2 = lostTypeParameter || isTurnedToRaw(extendedType);
            extendedType = simplifyType(extendedType);
            // it has to be a Class
            Class extendedTypeDeclaration = (Class) extendedType.getDeclaration();
            // looks like Object's superclass is Object, so stop right there
            if(extendedTypeDeclaration != typeFact().getObjectDeclaration())
                return lostTypeParameterInInheritance(extendedTypeDeclaration, commonDecl, searchInterfaces, lostTypeParameter2);
        }
        // didn't find it
View Full Code Here

            Tree.TypeArguments typeArguments = qmte.getTypeArguments();
            ProducedReference producedReference = method.getProducedReference(qualifyingType, typeArguments.getTypeModels());
            return utilInvocation().checkNull(makeJavaStaticInvocation(gen(),
                    method, producedReference, parameterList));
        } else if (decl instanceof Class) {
            Class class_ = (Class)decl;
            final ParameterList parameterList = class_.getParameterLists().get(0);
            ProducedReference producedReference = qmte.getTarget();
            return utilInvocation().checkNull(makeJavaStaticInvocation(gen(),
                    class_, producedReference, parameterList));
        } else {
            return makeErroneous(qmte, "compiler bug: unsupported static");
View Full Code Here

            Map<Class, ListBuffer<JCAnnotation>> annotationSet) {
        at(invocation);
        try {
            JCAnnotation annotation = AnnotationInvocationVisitor.transformConstructor(this, invocation);
            if (annotation != null) {
                Class annotationClass = AnnotationInvocationVisitor.annoClass(invocation);
                putAnnotation(annotationSet, annotation, annotationClass);
            }
        } catch (BugException e) {
            e.addError(invocation);
        }
View Full Code Here

            // only get it from the classpath if we're not compiling it, unless
            // it happens to be a java source
            if(classSymbol != null && (!classSymbol.isLoadedFromSource() || classSymbol.isJavaSource())) {
                d = modelLoader.convertToDeclaration(module, className, DeclarationType.VALUE);
                if (d instanceof Class) {
                    Class c = (Class) d;
                    if (c.isAbstraction() && signature != null) {
                        ArrayList<Declaration> list = new ArrayList<Declaration>(c.getOverloads());
                        list.add(c);
                        return lookupMember(list, name, signature, ellipsis);
                    }
                }
                return d;
View Full Code Here

TOP

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

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.