use of com.redhat.ceylon.model.typechecker.model.TypeDeclaration in project ceylon-compiler by ceylon.
the class NamingTests method testoo.
@Test
public void testoo() throws Exception {
final TypeDeclaration decl = findType("oo.ceylon", "oo.o");
Assert.assertEquals("o_", naming.makeTypeDeclarationName(decl));
Assert.assertEquals(QUAL + "oo_.o_", naming.makeTypeDeclarationName(decl, QUALIFIED));
assertEquals("com.redhat.ceylon.compiler.java.codegen.oo_.o_.get_", CodegenUtil.getJavaNameOfDeclaration(decl));
}
use of com.redhat.ceylon.model.typechecker.model.TypeDeclaration in project ceylon-compiler by ceylon.
the class NamingTests method testfIC.
@Test
public void testfIC() throws Exception {
final TypeDeclaration decl = findType("fIC.ceylon", "fIC.IC.C");
Assert.assertEquals("C", naming.makeTypeDeclarationName(decl));
Assert.assertEquals("IC$impl.C", naming.makeTypeDeclarationName(decl, QUALIFIED));
try {
CodegenUtil.getJavaNameOfDeclaration(decl);
fail();
} catch (IllegalArgumentException e) {
}
}
use of com.redhat.ceylon.model.typechecker.model.TypeDeclaration in project ceylon-compiler by ceylon.
the class NamingTests method testfC.
@Test
public void testfC() throws Exception {
final TypeDeclaration decl = findType("fC.ceylon", "fC.C");
Assert.assertEquals("C", naming.makeTypeDeclarationName(decl));
Assert.assertEquals("C$impl", naming.makeTypeDeclarationName(decl, COMPANION));
Assert.assertEquals("C", naming.makeTypeDeclarationName(decl, QUALIFIED));
Assert.assertEquals("C$impl", naming.makeTypeDeclarationName(decl, COMPANION, QUALIFIED));
try {
CodegenUtil.getJavaNameOfDeclaration(decl);
fail();
} catch (IllegalArgumentException e) {
}
}
use of com.redhat.ceylon.model.typechecker.model.TypeDeclaration in project ceylon-compiler by ceylon.
the class NamingTests method testC.
@Test
public void testC() throws Exception {
final TypeDeclaration decl = findType("C.ceylon", "C");
Assert.assertEquals("C", naming.makeTypeDeclarationName(decl));
Assert.assertEquals(QUAL + "C", naming.makeTypeDeclarationName(decl, QUALIFIED));
assertEquals("com.redhat.ceylon.compiler.java.codegen.C", CodegenUtil.getJavaNameOfDeclaration(decl));
}
use of com.redhat.ceylon.model.typechecker.model.TypeDeclaration in project ceylon-compiler by ceylon.
the class TypeParserTests method assertTypeWithParameters.
private void assertTypeWithParameters(Type type) {
Assert.assertNotNull(type);
TypeDeclaration declaration = type.getDeclaration();
Assert.assertNotNull(declaration);
Assert.assertTrue(declaration instanceof Class);
Assert.assertEquals("t2", declaration.getName());
List<Type> tal = type.getTypeArgumentList();
Assert.assertEquals(2, tal.size());
Assert.assertEquals("b", tal.get(0).getDeclaration().getName());
Assert.assertTrue(tal.get(0).getDeclaration() instanceof Class);
Assert.assertEquals("c", tal.get(1).getDeclaration().getName());
Assert.assertTrue(tal.get(1).getDeclaration() instanceof Class);
}
Aggregations