FIR: add test with resolve problem in delegate
This commit is contained in:
committed by
teamcity
parent
89c3e04a36
commit
a19495cb26
+43
@@ -0,0 +1,43 @@
|
||||
FILE: hideBySeverity.kt
|
||||
public abstract class StoredPropertyBase<T> : R|kotlin/properties/ReadWriteProperty<BaseState, T>| {
|
||||
public constructor<T>(): R|StoredPropertyBase<T>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
public abstract class StoredPropertyDerived<T> : R|StoredPropertyBase<T>| {
|
||||
public constructor<T>(): R|StoredPropertyDerived<T>| {
|
||||
super<R|StoredPropertyBase<T>|>()
|
||||
}
|
||||
|
||||
public final operator fun provideDelegate(thisRef: R|kotlin/Any|, property: R|kotlin/reflect/KProperty<*>|): R|StoredPropertyBase<T>| {
|
||||
^provideDelegate this@R|/StoredPropertyDerived|
|
||||
}
|
||||
|
||||
}
|
||||
public abstract class BaseState : R|kotlin/Any| {
|
||||
public constructor(): R|BaseState| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
protected abstract fun <PROPERTY_TYPE> propertyDerived(initialValue: R|PROPERTY_TYPE|): R|StoredPropertyDerived<PROPERTY_TYPE>|
|
||||
|
||||
protected abstract fun <PROPERTY_TYPE> propertyBase(initialValue: R|PROPERTY_TYPE|): R|StoredPropertyBase<PROPERTY_TYPE>|
|
||||
|
||||
}
|
||||
public abstract class Some : R|BaseState| {
|
||||
public constructor(): R|Some| {
|
||||
super<R|BaseState|>()
|
||||
}
|
||||
|
||||
public final val hideBySeverityDerived: R|kotlin/collections/MutableSet<kotlin/Int>|by this@R|/Some|.<CS errors: /BaseState.propertyDerived>#<R|ERROR CLASS: Cannot infer argument for type parameter PROPERTY_TYPE|>(R|kotlin/collections/mutableSetOf|<R|ERROR CLASS: Cannot infer argument for type parameter T|>()).R|SubstitutionOverride</StoredPropertyDerived.provideDelegate: R|StoredPropertyBase<ERROR CLASS: Cannot infer argument for type parameter PROPERTY_TYPE>|>|(this@R|/Some|, ::R|/Some.hideBySeverityDerived|)
|
||||
public get(): R|kotlin/collections/MutableSet<kotlin/Int>| {
|
||||
^ this@R|/Some|.D|/Some.hideBySeverityDerived|.R|SubstitutionOverride</StoredPropertyBase.getValue: <ERROR TYPE REF: Cannot infer argument for type parameter PROPERTY_TYPE>>|(this@R|/Some|, ::R|/Some.hideBySeverityDerived|)
|
||||
}
|
||||
|
||||
public final val hideBySeverityBase: R|kotlin/collections/MutableSet<kotlin/Int>|by this@R|/Some|.R|/BaseState.propertyBase|<R|kotlin/collections/MutableSet<kotlin/Int>|>(R|kotlin/collections/mutableSetOf|<R|kotlin/Int|>())
|
||||
public get(): R|kotlin/collections/MutableSet<kotlin/Int>| {
|
||||
^ this@R|/Some|.D|/Some.hideBySeverityBase|.R|SubstitutionOverride</StoredPropertyBase.getValue: R|kotlin/collections/MutableSet<kotlin/Int>|>|(this@R|/Some|, ::R|/Some.hideBySeverityBase|)
|
||||
}
|
||||
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
import kotlin.reflect.KProperty
|
||||
import kotlin.properties.ReadWriteProperty
|
||||
|
||||
// type must be exposed otherwise `provideDelegate` doesn't work
|
||||
abstract class StoredPropertyBase<T> : ReadWriteProperty<BaseState, T>
|
||||
|
||||
abstract class StoredPropertyDerived<T> : StoredPropertyBase<T>() {
|
||||
operator fun provideDelegate(thisRef: Any, property: KProperty<*>): StoredPropertyBase<T> {
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
abstract class BaseState {
|
||||
protected abstract fun <PROPERTY_TYPE> propertyDerived(initialValue: PROPERTY_TYPE): StoredPropertyDerived<PROPERTY_TYPE>
|
||||
|
||||
protected abstract fun <PROPERTY_TYPE> propertyBase(initialValue: PROPERTY_TYPE): StoredPropertyBase<PROPERTY_TYPE>
|
||||
}
|
||||
|
||||
abstract class Some : BaseState() {
|
||||
val hideBySeverityDerived: MutableSet<Int> by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>propertyDerived<!>(mutableSetOf())
|
||||
|
||||
val hideBySeverityBase: MutableSet<Int> by propertyBase(mutableSetOf())
|
||||
}
|
||||
Reference in New Issue
Block a user