Search in sources :

Example 1 with MultiTargetPlatform

use of org.jetbrains.kotlin.resolve.MultiTargetPlatform in project kotlin by JetBrains.

the class CheckerTestUtil method getDiagnosticsIncludingSyntaxErrors.

@NotNull
public static List<ActualDiagnostic> getDiagnosticsIncludingSyntaxErrors(@NotNull BindingContext bindingContext, @NotNull List<Pair<MultiTargetPlatform, BindingContext>> implementingModulesBindings, @NotNull PsiElement root, boolean markDynamicCalls, @Nullable List<DeclarationDescriptor> dynamicCallDescriptors) {
    List<ActualDiagnostic> result = getDiagnosticsIncludingSyntaxErrors(bindingContext, root, markDynamicCalls, dynamicCallDescriptors, null);
    List<Pair<MultiTargetPlatform, BindingContext>> sortedBindings = CollectionsKt.sortedWith(implementingModulesBindings, new Comparator<Pair<MultiTargetPlatform, BindingContext>>() {

        @Override
        public int compare(Pair<MultiTargetPlatform, BindingContext> o1, Pair<MultiTargetPlatform, BindingContext> o2) {
            return o1.getFirst().compareTo(o2.getFirst());
        }
    });
    for (Pair<MultiTargetPlatform, BindingContext> binding : sortedBindings) {
        MultiTargetPlatform platform = binding.getFirst();
        assert platform instanceof MultiTargetPlatform.Specific : "Implementing module must have a specific platform: " + platform;
        result.addAll(getDiagnosticsIncludingSyntaxErrors(binding.getSecond(), root, markDynamicCalls, dynamicCallDescriptors, ((MultiTargetPlatform.Specific) platform).getPlatform()));
    }
    return result;
}
Also used : MultiTargetPlatform(org.jetbrains.kotlin.resolve.MultiTargetPlatform) BindingContext(org.jetbrains.kotlin.resolve.BindingContext) Pair(kotlin.Pair) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

Pair (kotlin.Pair)1 NotNull (org.jetbrains.annotations.NotNull)1 BindingContext (org.jetbrains.kotlin.resolve.BindingContext)1 MultiTargetPlatform (org.jetbrains.kotlin.resolve.MultiTargetPlatform)1