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

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


    @Test
    public void testIopCallsDefaultAccessClassWithOverloading(){
        compile("access/JavaDefaultAccessClass4.java");
        assertErrors("access/CallsDefaultAccessClassWithOverloading",
                new CompilerError(22, "ambiguous invocation of overloaded method or class: there must be exactly one overloaded declaration of 'JavaDefaultAccessClass4' that accepts the given argument types ''")
        );
    }
View Full Code Here


    @Test
    public void testIopCallsDefaultAccessClassInAnotherPkg(){
        compile("access/JavaAccessModifiers.java");
        compile("access/JavaDefaultAccessClass3.java");
        assertErrors("CallsDefaultAccessClassInAnotherPkg",
                new CompilerError(21, "imported declaration is not shared: 'JavaDefaultAccessClass'"),
                new CompilerError(22, "imported declaration is not shared: 'JavaDefaultAccessClass2'"),
                new CompilerError(28, "type is not visible: 'JavaDefaultAccessClass'"),
                new CompilerError(29, "type is not visible: 'JavaDefaultAccessClass2'"),
                new CompilerError(30, "type constructor is not visible: 'JavaDefaultAccessClass3'")
        );
    }
View Full Code Here

    @Test
    public void testIopCallsDefaultAccessClassInAnotherPkgWithOverloading(){
        compile("access/JavaDefaultAccessClass4.java");
        assertErrors("CallsDefaultAccessClassInAnotherPkgWithOverloading",
                new CompilerError(26, "ambiguous invocation of overloaded method or class: there must be exactly one overloaded declaration of 'JavaDefaultAccessClass4' that accepts the given argument types ''"),
                new CompilerError(27, "type constructor is not visible: 'JavaDefaultAccessClass4'"),
                new CompilerError(28, "protected constructor is not visible: 'JavaDefaultAccessClass4'")
        );
    }
View Full Code Here

    @Test
    public void testIopCallsDefaultAccessMethodInAnotherPkg(){
        compile("access/JavaAccessModifiers.java");
        assertErrors("CallsDefaultAccessMethodInAnotherPkg",
                new CompilerError(25, "protected method or attribute is not visible: 'protectedAccessMethod' of type 'JavaAccessModifiers'"),
                new CompilerError(27, "package private method or attribute is not visible: 'defaultAccessMethod' of type 'JavaAccessModifiers'"),
                new CompilerError(36, "package private function or value is not visible: 'defaultAccessMethod'"));
    }
View Full Code Here

    @Test
    public void testIopRefinesDefaultAccessMethodInAnotherPkg(){
        compile("access/JavaAccessModifiers.java");
        assertErrors("RefinesDefaultAccessMethodInAnotherPkg",
                new CompilerError(27, "refined declaration is not visible: 'defaultAccessMethod' in 'JavaAccessModifiers'"));
    }
View Full Code Here

    }

    @Test
    public void testIopNamedInvocations(){
        assertErrors("NamedInvocations",
                new CompilerError(30, "overloaded declarations may not be called using named arguments: 'createTempFile'"),
                new CompilerError(30, "ambiguous callable reference to overloaded method or class: 'createTempFile' is overloaded"),
                new CompilerError(30, "named invocations of Java methods not supported"),
                new CompilerError(32, "named invocations of Java methods not supported"),
                new CompilerError(35, "named invocations of Java methods not supported"),
                new CompilerError(35, "overloaded declarations may not be called using named arguments: 'createTempFile'"),
                new CompilerError(35, "ambiguous callable reference to overloaded method or class: 'createTempFile' is overloaded"),
                new CompilerError(37, "named invocations of Java methods not supported")
        );
    }
View Full Code Here

    @Test
    public void testIopOverrideStaticMethods(){
        compile("JavaWithStaticMembers.java");
        assertErrors("OverrideStaticMethods",
                new CompilerError(26, "member refines a non-default, non-formal member: 'topMethod' in 'JavaWithStaticMembers'"),
                new CompilerError(28, "member refines a non-default, non-formal member: 'topField' in 'JavaWithStaticMembers'")
        );
    }
View Full Code Here

    }
   
    @Test
    public void testBannedAnnotation(){
      assertErrors("BannedAnnotation",
              new CompilerError(12, "inappropiate java annotation: interoperation with @Target is not supported"),
              new CompilerError(13, "inappropiate java annotation: interoperation with @Retention is not supported"),
              new CompilerError(16, "inappropiate java annotation: interoperation with @Deprecated is not supported: use deprecated"),
              new CompilerError(17, "inappropiate java annotation: interoperation with @Override is not supported: use actual"));
    }
View Full Code Here

   
    @Test
    public void testSealedInterop(){
        compile("access/JavaSealed.java");
        assertErrors("Sealed",
                new CompilerError(27, "package private constructor is not visible: 'JavaSealed'"),
                new CompilerError(29, "invokes or references a sealed class in a different module: 'Runtime' in 'java.base'"),
                new CompilerError(30, "type constructor is not visible: 'JavaSealed'"));
    }
View Full Code Here

    // Dynamic blocks

    @Test
    public void testDynBlock(){
        assertErrors("dynamic/Dynamic",
                new CompilerError(22, "dynamic is not yet supported on this platform"),
                new CompilerError(25, "dynamic is not yet supported on this platform"),
                new CompilerError(26, "dynamic is not yet supported on this platform"),
                new CompilerError(26, "value type could not be inferred"));
    }
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.