TypeInfo.getClassObject(), for now implemented via reflection

This commit is contained in:
Dmitry Jemerov
2011-07-08 12:30:51 +02:00
parent dac522d7a9
commit fc9f1eec4f
3 changed files with 29 additions and 0 deletions
@@ -104,6 +104,16 @@ public class TypeInfoTest extends CodegenTestCase {
blackBoxFile("typeInfo/forwardTypeParameter.jet");
}
public void testClassObjectInTypeInfo() throws Exception {
loadFile();
Method foo = generateFunction();
JetObject jetObject = (JetObject) foo.invoke(null);
TypeInfo<?> typeInfo = jetObject.getTypeInfo();
final Object object = typeInfo.getClassObject();
final Method classObjFoo = object.getClass().getMethod("foo");
assertNotNull(classObjFoo);
}
private Runnable newRunnable() {
return new Runnable() {
@Override