Fix project compilation against bootstrap compiler
Follow-up of 705a8a22, there were several usages of SAM conversions
for Kotlin functions
This commit is contained in:
@@ -418,7 +418,7 @@ object CheckerTestUtil {
|
||||
psiFile,
|
||||
diagnostics,
|
||||
emptyMap(),
|
||||
{ it.text },
|
||||
com.intellij.util.Function { it.text },
|
||||
emptyList(),
|
||||
false,
|
||||
false
|
||||
@@ -565,9 +565,9 @@ object CheckerTestUtil {
|
||||
): List<AbstractDiagnosticDescriptor> {
|
||||
val validDiagnostics = diagnostics.filter { actualDiagnostic -> actualDiagnostic.diagnostic.isValid }
|
||||
val diagnosticDescriptors = groupDiagnosticsByTextRange(validDiagnostics, uncheckedDiagnostics)
|
||||
diagnosticDescriptors.sortWith { d1: AbstractDiagnosticDescriptor, d2: AbstractDiagnosticDescriptor ->
|
||||
diagnosticDescriptors.sortWith(Comparator { d1: AbstractDiagnosticDescriptor, d2: AbstractDiagnosticDescriptor ->
|
||||
if (d1.start != d2.start) d1.start - d2.start else d2.end - d1.end
|
||||
}
|
||||
})
|
||||
return diagnosticDescriptors
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.resolve
|
||||
|
||||
import com.intellij.openapi.util.ThrowableComputable
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
import org.jetbrains.kotlin.builtins.getReceiverTypeFromFunctionType
|
||||
@@ -264,9 +265,9 @@ class FunctionDescriptorResolver(
|
||||
if (!isContractsEnabled || !function.mayHaveContract()) return null
|
||||
|
||||
return LazyContractProvider(storageManager) {
|
||||
AstLoadingFilter.forceAllowTreeLoading(function.containingFile) {
|
||||
AstLoadingFilter.forceAllowTreeLoading(function.containingFile, ThrowableComputable {
|
||||
expressionTypingServices.getBodyExpressionType(trace, scope, dataFlowInfo, function, functionDescriptor)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -325,7 +325,7 @@ abstract class BaseDiagnosticsTest : KotlinMultiFileTestWithJava<TestModule, Tes
|
||||
ktFile,
|
||||
filteredDiagnostics,
|
||||
diagnosticToExpectedDiagnostic,
|
||||
{ file -> file.text },
|
||||
com.intellij.util.Function { file -> file.text },
|
||||
uncheckedDiagnostics,
|
||||
withNewInferenceDirective,
|
||||
renderDiagnosticMessages
|
||||
|
||||
Reference in New Issue
Block a user