Caleb B
12/26/2025, 10:50 PMYoussef Shoaib [MOD]
12/26/2025, 11:20 PMCaleb B
12/26/2025, 11:43 PMZac Sweers
12/27/2025, 12:12 AMDeprecated(HIDDEN) does mess up resolution, sadly.I (and kotlinx-serialization) use this heavily with no issues, what specific issue are you seeing?
Caleb B
12/27/2025, 1:03 AMZac Sweers
12/27/2025, 1:04 AMCaleb B
12/27/2025, 1:07 AMMyClass#set-someProperty(Int)) wasn't able to be resolved in the FIR when I generated the @Deprecated(HIDDEN) annotation on it. Something like R|<local>/x|MyClass.<Unresolved reference:set-someProperty>#|(Int(2))Caleb B
12/27/2025, 1:08 AMCaleb B
12/27/2025, 1:16 AMR|<local>/x|.R|foo/MyClass.set-someProperty<Inapplicable(INAPPLICABLE): foo/MyClass.set-someProperty>#|(String(a string))
with the generated function in question being:
@R|kotlin/Deprecated|(message = String(Use the native property setter), level = kotlin/DeprecationLevel.HIDDEN) public final fun set-someProperty(<set-?>: R|kotlin/String|): R|kotlin/Unit| {
this@R|foo/MyClass|.R|foo/MyClass.someProperty| = R|<local>/<set-?>|
}Zac Sweers
12/27/2025, 1:18 AMCaleb B
12/27/2025, 1:18 AMset-propertyName function, since I can't get the type of the rvalue when the assignment transformer is runZac Sweers
12/27/2025, 1:21 AMCaleb B
12/27/2025, 1:22 AMclass MyClass {
@HasCustomSetters
var someProperty: String = ""
}
fun test() {
val inst = MyClass()
inst.someProperty = "some string"
}
is being transformed into this:
class MyClass {
@HasCustomSetters
var someProperty: String = ""
fun `set-someProperty`(`<set-?>`: String) {
this.someProperty = `<set-?>`
}
}
fun test() {
val inst = MyClass()
inst.`set-someProperty`("some string")
}
This is my basic "are the transformers being run" diagnostic test; no errors are supposed to be thrown here.Zac Sweers
12/27/2025, 1:23 AMCaleb B
12/27/2025, 1:23 AMCaleb B
12/27/2025, 1:23 AMCaleb B
12/27/2025, 1:23 AMCaleb B
12/27/2025, 1:26 AMCaleb B
12/27/2025, 1:27 AMCaleb B
12/27/2025, 1:27 AMZac Sweers
12/27/2025, 1:28 AMZac Sweers
12/27/2025, 1:28 AMCaleb B
12/27/2025, 1:28 AMCaleb B
12/27/2025, 1:28 AMCaleb B
12/27/2025, 1:28 AMCaleb B
12/27/2025, 1:29 AMCaleb B
12/27/2025, 1:30 AMCaleb B
12/27/2025, 1:36 AM@Deprecated annotation... if I had to guess, it causes the diagnostic test to completely ignore the function? Or it's just reporting the "calling a deprecated function" diagnostic?
Whether it can't resolve the function at all, or it just gives a "deprecated" error when you do the assignment, either way it's pretty bad for the user. So I gave up on it, and was hoping someone knew an alternative for hiding it from intellisense.Caleb B
12/27/2025, 1:37 AMCaleb B
12/27/2025, 1:42 AMset-bar(PropertysOwnType) calls back to the vanilla property sets. This could all be avoided if I just had access to the rvalue's type in the assignment expression...Caleb B
12/27/2025, 1:45 AMjava.lang.IllegalStateException: ARGUMENT_TYPE_MISMATCH: Argument type mismatch: actual type is 'String', but 'Int' was expected. at bar.kt:(181,191)
I'm very grateful for the helpYoussef Shoaib [MOD]
12/27/2025, 11:07 AMCaleb B
12/28/2025, 12:17 AMYoussef Shoaib [MOD]
12/28/2025, 12:24 AMsuspendCoroutineUninterceptedOrReturn and startCoroutineUninterceptedOrReturn from IDE. Maybe see if that's configurable somehow?Caleb B
12/28/2025, 12:31 AMYoussef Shoaib [MOD]
12/28/2025, 12:35 AM