Package kiss.lang.type

Examples of kiss.lang.type.FunctionType


 
  static final Object[] testObjects={null,0,1,true,false,"Foo",1.0,new Object(),Anything.INSTANCE};


  @Test public void testFnType() {
    FunctionType t=FunctionType.create(Null.INSTANCE,JavaType.create(Integer.class));
    assertEquals(1,t.getArity());
   
    assertTrue(t.contains(FunctionType.create(Null.INSTANCE,JavaType.create(Number.class))));
    assertFalse(t.contains(FunctionType.create(Null.INSTANCE,JavaType.create(String.class))));
  }
View Full Code Here


  };
 
  @Test
  public void testIdentity() {
    Lambda id=Lambda.IDENTITY;
    FunctionType ft=(FunctionType) id.getType();
    assertEquals(Anything.INSTANCE,ft.getReturnType());
    IFn fn=(IFn) id.eval();
    assertEquals(1,fn.invoke(1));
    assertTrue(ft.checkInstance(fn));
  }
View Full Code Here

TOP

Related Classes of kiss.lang.type.FunctionType

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.