Search in sources :

Example 16 with ClassDescriptor

use of org.jetbrains.kotlin.descriptors.ClassDescriptor in project kotlin by JetBrains.

the class JSTestGenerator method doGenerateTestCalls.

private static void doGenerateTestCalls(@NotNull List<FunctionDescriptor> functionDescriptors, @NotNull TranslationContext context, @NotNull JSTester jsTester) {
    for (FunctionDescriptor functionDescriptor : functionDescriptors) {
        ClassDescriptor classDescriptor = DescriptorUtils.getContainingClass(functionDescriptor);
        if (classDescriptor == null) {
            return;
        }
        generateCodeForTestMethod(context, functionDescriptor, classDescriptor, jsTester);
    }
}
Also used : ClassDescriptor(org.jetbrains.kotlin.descriptors.ClassDescriptor) FunctionDescriptor(org.jetbrains.kotlin.descriptors.FunctionDescriptor)

Example 17 with ClassDescriptor

use of org.jetbrains.kotlin.descriptors.ClassDescriptor in project kotlin by JetBrains.

the class JavaToKotlinClassMap method mapPlatformClass.

@NotNull
public Collection<ClassDescriptor> mapPlatformClass(@NotNull FqName fqName, @NotNull KotlinBuiltIns builtIns) {
    ClassDescriptor kotlinAnalog = mapJavaToKotlin(fqName, builtIns);
    if (kotlinAnalog == null)
        return Collections.emptySet();
    FqName kotlinMutableAnalogFqName = readOnlyToMutable.get(getFqNameUnsafe(kotlinAnalog));
    if (kotlinMutableAnalogFqName == null)
        return Collections.singleton(kotlinAnalog);
    return Arrays.asList(kotlinAnalog, builtIns.getBuiltInClassByFqName(kotlinMutableAnalogFqName));
}
Also used : FunctionClassDescriptor(org.jetbrains.kotlin.builtins.functions.FunctionClassDescriptor) ClassDescriptor(org.jetbrains.kotlin.descriptors.ClassDescriptor) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ClassDescriptor (org.jetbrains.kotlin.descriptors.ClassDescriptor)17 NotNull (org.jetbrains.annotations.NotNull)5 ClassifierDescriptor (org.jetbrains.kotlin.descriptors.ClassifierDescriptor)5 DeclarationDescriptor (org.jetbrains.kotlin.descriptors.DeclarationDescriptor)3 MemberScope (org.jetbrains.kotlin.resolve.scopes.MemberScope)3 ArrayList (java.util.ArrayList)2 FunctionDescriptor (org.jetbrains.kotlin.descriptors.FunctionDescriptor)2 ModuleDescriptor (org.jetbrains.kotlin.descriptors.ModuleDescriptor)2 TypeParameterDescriptor (org.jetbrains.kotlin.descriptors.TypeParameterDescriptor)2 KtClass (org.jetbrains.kotlin.psi.KtClass)2 KtDeclaration (org.jetbrains.kotlin.psi.KtDeclaration)2 KtFile (org.jetbrains.kotlin.psi.KtFile)2 Type (org.jetbrains.org.objectweb.asm.Type)2 Disposable (com.intellij.openapi.Disposable)1 PsiMethod (com.intellij.psi.PsiMethod)1 File (java.io.File)1 ZipEntry (java.util.zip.ZipEntry)1 TestRunner (junit.textui.TestRunner)1 Unit (kotlin.Unit)1 Nullable (org.jetbrains.annotations.Nullable)1