Remove old 'get' delegate convention in interfaces
This commit is contained in:
+1
-1
@@ -22,7 +22,7 @@ import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget.*
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.resolve.BindingContext
|
||||
import org.jetbrains.kotlin.storage.StorageManager
|
||||
import org.jetbrains.kotlin.storage.get
|
||||
import org.jetbrains.kotlin.storage.getValue
|
||||
|
||||
/*
|
||||
This class lazily splits Annotations into several different Annotations according to declaration site target priority on property.
|
||||
|
||||
@@ -22,9 +22,6 @@ import com.intellij.openapi.util.UserDataHolder
|
||||
import com.intellij.psi.PsiElement
|
||||
|
||||
public class UserDataProperty<in R: UserDataHolder, T : Any>(val key: Key<T>, val default: T? = null) {
|
||||
fun get(thisRef: R, desc: kotlin.PropertyMetadata) = getValue(thisRef, desc)
|
||||
fun set(thisRef: R, desc: kotlin.PropertyMetadata, value: T?) = setValue(thisRef, desc, value)
|
||||
|
||||
fun getValue(thisRef: R, desc: kotlin.PropertyMetadata): T? {
|
||||
return thisRef.getUserData(key)
|
||||
}
|
||||
@@ -35,9 +32,6 @@ public class UserDataProperty<in R: UserDataHolder, T : Any>(val key: Key<T>, va
|
||||
}
|
||||
|
||||
public class NotNullableUserDataProperty<in R: UserDataHolder, T : Any>(val key: Key<T>, val defaultValue: T) {
|
||||
fun get(thisRef: R, desc: kotlin.PropertyMetadata) = getValue(thisRef, desc)
|
||||
fun set(thisRef: R, desc: kotlin.PropertyMetadata, value: T) = setValue(thisRef, desc, value)
|
||||
|
||||
fun getValue(thisRef: R, desc: kotlin.PropertyMetadata): T {
|
||||
return thisRef.getUserData(key) ?: defaultValue
|
||||
}
|
||||
@@ -48,9 +42,6 @@ public class NotNullableUserDataProperty<in R: UserDataHolder, T : Any>(val key:
|
||||
}
|
||||
|
||||
public class CopyableUserDataProperty<in R: PsiElement, T : Any>(val key: Key<T>, val default: T? = null) {
|
||||
fun get(thisRef: R, desc: kotlin.PropertyMetadata) = getValue(thisRef, desc)
|
||||
fun set(thisRef: R, desc: kotlin.PropertyMetadata, value: T?) = setValue(thisRef, desc, value)
|
||||
|
||||
fun getValue(thisRef: R, property: PropertyMetadata): T? {
|
||||
return thisRef.getCopyableUserData(key)
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.jetbrains.kotlin.resolve.*
|
||||
import org.jetbrains.kotlin.resolve.bindingContextUtil.recordScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.JetScope
|
||||
import org.jetbrains.kotlin.storage.StorageManager
|
||||
import org.jetbrains.kotlin.storage.get
|
||||
import org.jetbrains.kotlin.storage.getValue
|
||||
import org.jetbrains.kotlin.utils.sure
|
||||
import java.util.*
|
||||
|
||||
|
||||
Reference in New Issue
Block a user