Search in sources :

Example 46 with TypeDescriptor

use of org.eclipse.ceylon.compiler.java.runtime.model.TypeDescriptor in project ceylon by eclipse.

the class TypeDescriptorTest method testTupleTypeString.

@Test
public void testTupleTypeString() {
    TypeDescriptor tuple2 = TypeDescriptor.tuple(false, false, -1, Integer.$TypeDescriptor$, String.$TypeDescriptor$);
    Assert.assertEquals("[ceylon.language.Integer,ceylon.language.String]", tuple2.toString());
    TypeDescriptor tuple2Star = TypeDescriptor.tuple(true, false, -1, Integer.$TypeDescriptor$, String.$TypeDescriptor$);
    Assert.assertEquals("[ceylon.language.Integer,ceylon.language.String*]", tuple2Star.toString());
    TypeDescriptor tuple2Plus = TypeDescriptor.tuple(true, true, -1, Integer.$TypeDescriptor$, String.$TypeDescriptor$);
    Assert.assertEquals("[ceylon.language.Integer,ceylon.language.String+]", tuple2Plus.toString());
    TypeDescriptor tuple1Or2 = TypeDescriptor.tuple(false, false, 1, Integer.$TypeDescriptor$, String.$TypeDescriptor$);
    Assert.assertEquals("[ceylon.language.Integer,ceylon.language.String=]", tuple1Or2.toString());
    TypeDescriptor tuple0OrN = TypeDescriptor.tuple(true, false, 0, Integer.$TypeDescriptor$, String.$TypeDescriptor$);
    Assert.assertEquals("[ceylon.language.Integer=,ceylon.language.String*]", tuple0OrN.toString());
}
Also used : TypeDescriptor(org.eclipse.ceylon.compiler.java.runtime.model.TypeDescriptor) Test(org.junit.Test)

Aggregations

TypeDescriptor (org.eclipse.ceylon.compiler.java.runtime.model.TypeDescriptor)46 Metamodel (org.eclipse.ceylon.compiler.java.runtime.metamodel.Metamodel)23 TypeInfo (org.eclipse.ceylon.compiler.java.metadata.TypeInfo)18 TypeParameters (org.eclipse.ceylon.compiler.java.metadata.TypeParameters)17 Sequential (ceylon.language.Sequential)13 ReifiedType (org.eclipse.ceylon.compiler.java.runtime.model.ReifiedType)12 Type (org.eclipse.ceylon.model.typechecker.model.Type)11 OpenType (ceylon.language.meta.declaration.OpenType)9 ArrayList (java.util.ArrayList)9 ObjectArrayIterable (org.eclipse.ceylon.compiler.java.language.ObjectArrayIterable)9 MemberClassImpl (org.eclipse.ceylon.compiler.java.runtime.metamodel.meta.MemberClassImpl)7 ClassDeclaration (ceylon.language.meta.declaration.ClassDeclaration)5 Functional (org.eclipse.ceylon.model.typechecker.model.Functional)5 AssertionError (ceylon.language.AssertionError)4 ClassDeclarationImpl (org.eclipse.ceylon.compiler.java.runtime.metamodel.decl.ClassDeclarationImpl)4 ClassImpl (org.eclipse.ceylon.compiler.java.runtime.metamodel.meta.ClassImpl)4 ReflectionClass (org.eclipse.ceylon.model.loader.impl.reflect.mirror.ReflectionClass)4 UnknownType (org.eclipse.ceylon.model.typechecker.model.UnknownType)4 Metamodel.getTypeDescriptor (org.eclipse.ceylon.compiler.java.runtime.metamodel.Metamodel.getTypeDescriptor)3 LazyClass (org.eclipse.ceylon.model.loader.model.LazyClass)3