K2: Require resolved type for ResolutionMode.WithExpectedType
Implicit type might have two meaning there: - noExpectedType - unknown declaration type where this expression is assigned to For both cases, we've got ResolutionMode.ContextIndependent that works just fine
This commit is contained in:
committed by
Space Team
parent
df826f04a7
commit
e43d8bbb47
+3
-1
@@ -17,6 +17,7 @@ import org.jetbrains.kotlin.fir.resolve.calls.*
|
||||
import org.jetbrains.kotlin.fir.resolve.createConeDiagnosticForCandidateWithError
|
||||
import org.jetbrains.kotlin.fir.resolve.inference.FirCallCompleter
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
||||
import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeProjection
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeRef
|
||||
import org.jetbrains.kotlin.resolve.calls.tower.CandidateApplicability
|
||||
@@ -77,7 +78,8 @@ class SingleCandidateResolver(
|
||||
|
||||
val completionResult = firCallCompleter.completeCall(
|
||||
fakeCall,
|
||||
resolutionParameters.expectedType?.let(ResolutionMode::WithExpectedType) ?: ResolutionMode.ContextIndependent
|
||||
(resolutionParameters.expectedType as? FirResolvedTypeRef)?.let { ResolutionMode.WithExpectedType(it) }
|
||||
?: ResolutionMode.ContextIndependent
|
||||
)
|
||||
|
||||
return completionResult.takeIf { it.callCompleted }?.result
|
||||
|
||||
Reference in New Issue
Block a user