1e0d9f4075
For smart casts, elvises, etc., there are no implicit casts in psi2fir in changed test data
77 lines
1.8 KiB
Plaintext
Vendored
77 lines
1.8 KiB
Plaintext
Vendored
class SettingType<out V : Any> {
|
|
constructor(type: KClass<out V>) /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
val type: KClass<out V>
|
|
field = type
|
|
get
|
|
|
|
}
|
|
|
|
class SettingReference<V : Any, T : SettingType<V>> {
|
|
constructor(t: T, v: V) /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
var t: T
|
|
field = t
|
|
get
|
|
set
|
|
|
|
var v: V
|
|
field = v
|
|
get
|
|
set
|
|
|
|
}
|
|
|
|
class IdeWizard {
|
|
constructor() /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
var projectTemplate: Int? /* by */
|
|
field = <this>.setting<Int, SettingType<Int>>(reference = SettingReference<Int, SettingType<Int>>(t = SettingType<Int>(type = 42::class), v = 42))
|
|
get(): Int? {
|
|
return <this>.#projectTemplate$delegate.getValue(thisRef = <this>, property = IdeWizard::projectTemplate)
|
|
}
|
|
set(<set-?>: Int?) {
|
|
<this>.#projectTemplate$delegate.setValue(thisRef = <this>, property = IdeWizard::projectTemplate, value = <set-?>)
|
|
}
|
|
|
|
private fun <V : Any, T : SettingType<V>> setting(reference: SettingReference<V, T>): <no name provided><V, T> {
|
|
return { // BLOCK
|
|
local class <no name provided> : ReadWriteProperty<Any?, V?> {
|
|
private constructor() /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
override operator fun setValue(thisRef: Any?, property: KProperty<*>, value: V?) {
|
|
when {
|
|
EQEQ(arg0 = value, arg1 = null) -> return Unit
|
|
}
|
|
reference.<set-t>(<set-?> = SettingType<V>(type = value::class) as T)
|
|
reference.<set-v>(<set-?> = value)
|
|
}
|
|
|
|
override operator fun getValue(thisRef: Any?, property: KProperty<*>): V? {
|
|
return reference.<get-v>()
|
|
}
|
|
|
|
}
|
|
|
|
<no name provided>()
|
|
}
|
|
}
|
|
|
|
}
|