mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Minor: Convert CallablePlacement to sealed class
(cherry picked from commit 47073b5) GitOrigin-RevId: 130f275e58d92c07500940a19b20b11b4ddc5086
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3df0be85a3
commit
e2ed9103e9
+4
-4
@@ -125,9 +125,9 @@ class CallableBuilderConfiguration(
|
||||
val enableSubstitutions: Boolean = true
|
||||
)
|
||||
|
||||
interface CallablePlacement {
|
||||
class WithReceiver(val receiverTypeCandidate: TypeCandidate): CallablePlacement
|
||||
class NoReceiver(val containingElement: PsiElement): CallablePlacement
|
||||
sealed class CallablePlacement {
|
||||
class WithReceiver(val receiverTypeCandidate: TypeCandidate): CallablePlacement()
|
||||
class NoReceiver(val containingElement: PsiElement): CallablePlacement()
|
||||
}
|
||||
|
||||
class CallableBuilder(val config: CallableBuilderConfiguration) {
|
||||
@@ -243,7 +243,7 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
|
||||
val classDeclaration = receiverClassDescriptor?.let { DescriptorToSourceUtils.getSourceFromDescriptor(it) }
|
||||
containingElement = if (!config.isExtension && classDeclaration != null) classDeclaration else config.currentFile
|
||||
}
|
||||
else -> throw IllegalArgumentException("Unexpected placement: $placement")
|
||||
else -> throw IllegalArgumentException("Placement wan't initialized")
|
||||
}
|
||||
val receiverType = receiverClassDescriptor?.defaultType
|
||||
|
||||
|
||||
Reference in New Issue
Block a user