Minor. Have to deal with error descriptors like previous resolution does.
This commit is contained in:
@@ -93,7 +93,7 @@ class InnerClassViaStaticReference(val classDescriptor: ClassDescriptor): Resolu
|
||||
class UnsupportedInnerClassCall(val message: String): ResolutionDiagnostic(ResolutionCandidateApplicability.IMPOSSIBLE_TO_GENERATE)
|
||||
class UsedSmartCastForDispatchReceiver(val smartCastType: KotlinType): ResolutionDiagnostic(ResolutionCandidateApplicability.RESOLVED)
|
||||
|
||||
object ErrorDescriptorDiagnostic : ResolutionDiagnostic(ResolutionCandidateApplicability.INAPPLICABLE)
|
||||
object ErrorDescriptorDiagnostic : ResolutionDiagnostic(ResolutionCandidateApplicability.RESOLVED) // todo discuss and change to INAPPLICABLE
|
||||
object SynthesizedDescriptorDiagnostic: ResolutionDiagnostic(ResolutionCandidateApplicability.RESOLVED_SYNTHESIZED)
|
||||
object DynamicDescriptorDiagnostic: ResolutionDiagnostic(ResolutionCandidateApplicability.RESOLVED_SYNTHESIZED)
|
||||
object UnstableSmartCastDiagnostic: ResolutionDiagnostic(ResolutionCandidateApplicability.MAY_THROW_RUNTIME_ERROR)
|
||||
|
||||
@@ -47,15 +47,18 @@ internal abstract class AbstractScopeTowerLevel(
|
||||
val diagnostics = SmartList<ResolutionDiagnostic>()
|
||||
diagnostics.addIfNotNull(specialError)
|
||||
|
||||
if (ErrorUtils.isError(descriptor)) diagnostics.add(ErrorDescriptorDiagnostic)
|
||||
if (descriptor.isSynthesized) diagnostics.add(SynthesizedDescriptorDiagnostic)
|
||||
if (dispatchReceiverSmartCastType != null) diagnostics.add(UsedSmartCastForDispatchReceiver(dispatchReceiverSmartCastType))
|
||||
|
||||
Visibilities.findInvisibleMember(
|
||||
dispatchReceiver ?: ReceiverValue.NO_RECEIVER, descriptor,
|
||||
scopeTower.lexicalScope.ownerDescriptor
|
||||
)?.let { diagnostics.add(VisibilityError(it)) }
|
||||
if (ErrorUtils.isError(descriptor)) {
|
||||
diagnostics.add(ErrorDescriptorDiagnostic)
|
||||
}
|
||||
else {
|
||||
if (descriptor.isSynthesized) diagnostics.add(SynthesizedDescriptorDiagnostic)
|
||||
if (dispatchReceiverSmartCastType != null) diagnostics.add(UsedSmartCastForDispatchReceiver(dispatchReceiverSmartCastType))
|
||||
|
||||
Visibilities.findInvisibleMember(
|
||||
dispatchReceiver ?: ReceiverValue.NO_RECEIVER, descriptor,
|
||||
scopeTower.lexicalScope.ownerDescriptor
|
||||
)?.let { diagnostics.add(VisibilityError(it)) }
|
||||
}
|
||||
return CandidateWithBoundDispatchReceiverImpl(dispatchReceiver, descriptor, diagnostics)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user