Move DummyDelegate to :compiler:util

Deleted DummyDelegate from a pair of usages across the project, and
moved it to :compiler:util module to avoid further duplicates
This commit is contained in:
Iaroslav Postovalov
2023-09-12 22:56:57 +02:00
committed by Space Team
parent 2578bfefd5
commit fd2954a8d3
4 changed files with 6 additions and 14 deletions
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.diagnostics
import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.config.LanguageFeature
import org.jetbrains.kotlin.utils.DummyDelegate
import kotlin.properties.ReadOnlyProperty
import kotlin.reflect.KClass
import kotlin.reflect.KProperty
@@ -220,10 +221,3 @@ class DeprecationDiagnosticFactory4DelegateProvider<A, B, C, D>(
return DummyDelegate(KtDiagnosticFactoryForDeprecation4(featureForError, warningFactory, errorFactory))
}
}
private class DummyDelegate<T>(val value: T) : ReadOnlyProperty<Any?, T> {
override fun getValue(thisRef: Any?, property: KProperty<*>): T {
return value
}
}