use of org.jetbrains.kotlin.descriptors.ModuleDescriptor in project kotlin by JetBrains.
the class BoundsSubstitutorTest method doTest.
//public void testWithWhereTwoBoundsLoop() throws Exception {
// doTest("fun <T, R> f(l: List<R>): R where T : R, R : T",
// "");
//}
private void doTest(String text, String expected) {
KtFile ktFile = KtPsiFactoryKt.KtPsiFactory(getProject()).createFile("fun.kt", text);
ModuleDescriptor module = JvmResolveUtil.analyze(ktFile, getEnvironment()).getModuleDescriptor();
Collection<SimpleFunctionDescriptor> functions = module.getPackage(FqName.ROOT).getMemberScope().getContributedFunctions(Name.identifier("f"), NoLookupLocation.FROM_TEST);
FunctionDescriptor substituted = BoundsSubstitutor.substituteBounds(CollectionsKt.single(functions));
String actual = DescriptorRenderer.COMPACT.render(substituted);
assertEquals(expected, actual);
}
Aggregations