generate no-arg typeinfo

This commit is contained in:
Dmitry Jemerov
2011-07-12 13:41:57 +02:00
parent b95219913a
commit 8c0c0f9d6c
3 changed files with 23 additions and 5 deletions
@@ -23,13 +23,20 @@ public class TypeInfoTest extends CodegenTestCase {
assertNotNull(typeInfo);
}
public void testTypeOfOperator() throws Exception {
public void testOneArgTypeinfo() throws Exception {
loadFile();
Method foo = generateFunction();
TypeInfo typeInfo = (TypeInfo) foo.invoke(null);
assertNotNull(typeInfo);
}
public void testNoArgTypeinfo() throws Exception {
loadText("fun foo() = typeinfo.typeinfo<Int>()");
Method foo = generateFunction();
TypeInfo typeInfo = (TypeInfo) foo.invoke(null);
assertSame(TypeInfo.INT_TYPE_INFO, typeInfo);
}
public void testAsSafeOperator() throws Exception {
loadText("fun foo(x: Any) = x as? Runnable");
Method foo = generateFunction();