Package com.redhat.ceylon.compiler.java.test

Examples of com.redhat.ceylon.compiler.java.test.CompilerError


   
    @Test
    public void testBug1328() {
        // disabled because although we can compile them, we can't invoke them: https://github.com/ceylon/ceylon-compiler/issues/1664
        assertErrors("bug13xx/Bug1328",
                new CompilerError(29, "refined member type parameter Thing of 'make' in 'Bug1328_Factory' with upper bound which member type parameter Thing2 does not satisfy not yet supported: 'Things'"),
                new CompilerError(-1, "com.redhat.ceylon.compiler.java.test.issues.bug13xx.Bug1328 is not abstract and does not override abstract method <Thing>make(com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor,Thing) in com.redhat.ceylon.compiler.java.test.issues.bug13xx.Bug1328_Factory"));
    }
View Full Code Here


    @Test
    @Ignore("For 1.1 - See https://github.com/ceylon/ceylon-compiler/issues/1375")
    public void testBug1375() {
        assertErrors("bug13xx/Bug1375",
                new CompilerError(22, "does not definitely return: x"),
                new CompilerError(28, "cannot find symbol\n  symbol:   method x()\n  location: variable x of type com.redhat.ceylon.compiler.java.test.issues.bug13xx.Bug1375")
        );
    }
View Full Code Here

    }
   
    @Test
    public void testLopOptimArrayIterationStaticRequired(){
        assertErrors("loop/optim/ArrayIterationStaticRequired",
                new CompilerError(35, "@requireOptimization[\"ArrayIterationStatic\"] assertion failed: static type of iterable in for statement is not Array"),
                new CompilerError(39, "@requireOptimization[\"JavaArrayIterationStatic\"] assertion failed: iterable expression wasn't of form javaArray.array"));
    }
View Full Code Here

    }

    @Test
    public void testBug1392() {
        assertErrors("bug13xx/Bug1392",
                new CompilerError(25, "protected constructor is not visible: 'LogManager'"),
                new CompilerError(26, "invokes or references a sealed class in a different module: 'Class' in 'java.base'")
        );
    }
View Full Code Here

    }
   
    @Test
    public void testBug1405() {
        assertErrors("bug14xx/Bug1405",
                new CompilerError(24, "invokes or references a sealed class in a different module: 'State' in 'java.base'")
        );
    }
View Full Code Here

   
    @Test
    public void loadVariadic(){
        compile("Variadic.ceylon");
        assertErrors("variadictest",
                new CompilerError(7, "missing argument to required parameter 'seq' of 'VariadicPlus'")
        );
    }
View Full Code Here

   
    @Test
    public void bogusModelAnnotationsTopLevelAttribute(){
        compile("bogusTopLevelAttributeNoGetter_.java", "bogusTopLevelAttributeMissingType_.java", "bogusTopLevelAttributeInvalidType_.java");
        assertErrors("bogusTopLevelAttributeUser",
                new CompilerError(1, "Error while loading the com.redhat.ceylon.compiler.java.test.model/1 module:\n"
                        +"   Error while resolving toplevel attribute com.redhat.ceylon.compiler.java.test.model::bogusTopLevelAttributeNoGetter: getter method missing"),
                new CompilerError(-1, "Error while resolving type of toplevel attribute for com.redhat.ceylon.compiler.java.test.model::bogusTopLevelAttributeMissingType: Could not find type 'com.redhat.ceylon.compiler.java.test.model.MissingType'"),
                new CompilerError(-1, "Error while parsing type of toplevel attribute for com.redhat.ceylon.compiler.java.test.model::bogusTopLevelAttributeInvalidType: Expecting word but got AND"),
                new CompilerError(3, "could not determine type of function or value reference: 'bogusTopLevelAttributeNoGetter'"),
                new CompilerError(4, "could not determine type of function or value reference: 'bogusTopLevelAttributeMissingType'"),
                new CompilerError(5, "could not determine type of function or value reference: 'bogusTopLevelAttributeInvalidType'")
                );
    }
View Full Code Here

    @Test
    public void bogusModelAnnotationsTopLevelMethod(){
        compile("bogusTopLevelMethodNoMethod_.java", "bogusTopLevelMethodMissingType_.java", "bogusTopLevelMethodInvalidType_.java", "bogusTopLevelMethodNotStatic_.java");
        assertErrors("bogusTopLevelMethodUser",
                new CompilerError(1, "Error while loading the com.redhat.ceylon.compiler.java.test.model/1 module:\n"
                        +"   Error while resolving toplevel method com.redhat.ceylon.compiler.java.test.model::bogusTopLevelMethodNoMethod: static method missing"),
                new CompilerError(1, "Error while loading the com.redhat.ceylon.compiler.java.test.model/1 module:\n"
                        +"   Error while resolving toplevel method com.redhat.ceylon.compiler.java.test.model::bogusTopLevelMethodNotStatic: method is not static"),
                new CompilerError(1, "Error while loading the com.redhat.ceylon.compiler.java.test.model/1 module:\n"
                        +"   Error while resolving type of toplevel method for com.redhat.ceylon.compiler.java.test.model::bogusTopLevelMethodMissingType:\n"
                        +"   Could not find type 'com.redhat.ceylon.compiler.java.test.model.MissingType'"),
                new CompilerError(1, "Error while loading the com.redhat.ceylon.compiler.java.test.model/1 module:\n"
                        +"   Error while parsing type of toplevel method for com.redhat.ceylon.compiler.java.test.model::bogusTopLevelMethodInvalidType:\n"
                        +"   Expecting word but got AND"),
                // FIXME: this is not great
                new CompilerError(3, "function has no parameter list: 'bogusTopLevelMethodNoMethod'"),
                new CompilerError(3, "could not determine type of function or value reference: 'bogusTopLevelMethodNoMethod'"),
                // FIXME: this is not great
                new CompilerError(4, "function has no parameter list: 'bogusTopLevelMethodNotStatic'"),
                new CompilerError(4, "could not determine type of function or value reference: 'bogusTopLevelMethodNotStatic'"),
                new CompilerError(5, "could not determine type of function or value reference: 'bogusTopLevelMethodMissingType'"),
                new CompilerError(6, "could not determine type of function or value reference: 'bogusTopLevelMethodInvalidType'")
        );

    }
View Full Code Here

   
    @Test
    public void bogusModelAnnotationsTopLevelClass(){
        compile("BogusTopLevelClass.java", "BogusTopLevelClass2.java");
        assertErrors("bogusTopLevelClassUser",
                new CompilerError(1, "Error while loading the com.redhat.ceylon.compiler.java.test.model/1 module:\n"
                        +"   Error while resolving type of extended type for com.redhat.ceylon.compiler.java.test.model::BogusTopLevelClass:\n"
                        +"   Could not find type 'com.redhat.ceylon.compiler.java.test.model.MissingType'"),
                new CompilerError(-1, "Constructor for 'com.redhat.ceylon.compiler.java.test.model.BogusTopLevelClass' should take 1 reified type arguments (TypeDescriptor) but has '0': skipping constructor."),
                new CompilerError(-1, "Invalid type signature for self type of com.redhat.ceylon.compiler.java.test.model::BogusTopLevelClass: com.redhat.ceylon.compiler.java.test.model::MissingType is not a type parameter"),

                // FIXME: I wish I knew how to get rid of that one...
                new CompilerError(3, "constructor BogusTopLevelClass in class com.redhat.ceylon.compiler.java.test.model.BogusTopLevelClass<T> cannot be applied to given types;\n  required: no arguments\n  found: com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor\n  reason: actual and formal argument lists differ in length")
        );
    }
View Full Code Here

        assertFalse(ret);

        TreeSet<CompilerError> actualErrors = c.get(Diagnostic.Kind.ERROR);
        compareErrors(actualErrors,
//                new CompilerError(21, "cannot find module artifact notfound-1(.car|.jar)\n  \t- dependency tree: okmodule/1.0.0 -> notfound/1"),
                new CompilerError(20, "duplicate declaration name: 'run'"));
       
        File carFile = getModuleArchive("default", null);
        assertTrue(carFile.exists());

        JarFile car = new JarFile(carFile);
View Full Code Here

TOP

Related Classes of com.redhat.ceylon.compiler.java.test.CompilerError

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.