Don't check suitability of a builder inference call if unrestricted builder inference is enabled
^KT-42139 Fixed
This commit is contained in:
+5
-1
@@ -6,6 +6,7 @@
|
||||
package org.jetbrains.kotlin.resolve.calls.inference
|
||||
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
import org.jetbrains.kotlin.config.LanguageFeature
|
||||
import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.impl.*
|
||||
@@ -93,7 +94,10 @@ class BuilderInferenceSession(
|
||||
return subResolvedAtoms?.any { it.hasPostponed() } == true
|
||||
}
|
||||
|
||||
if (!candidate.isSuitableForBuilderInference()) {
|
||||
val isUnrestrictedBuilderInferenceSupported =
|
||||
callComponents.languageVersionSettings.supportsFeature(LanguageFeature.UnrestrictedBuilderInference)
|
||||
|
||||
if (!isUnrestrictedBuilderInferenceSupported && !candidate.isSuitableForBuilderInference()) {
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user