You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
Kotlin: public set of private var shouldn't be eliminated #1139
data class Foo(val value: String)
class FooManager {
private var customFoo: Foo? = null
private var defaultFoo = Foo("default")
val foo
get() = customFoo ?: defaultFoo
fun setCustomFoo(value: Foo) {
customFoo = value
}
}
setCustomFoo is a public set of a private var, but it shouldn't be eliminated because it's not generated because of Kotlin's "internal".
The equals make setType return Unit() and not void, so the test case does pass as expected. If we fix this, then the test case fails because setType is being removed.
I think the best course is to modify KotlinFixups::FixupProperty to only remove them if both the getter and setter exist and they're both public. There could still be some scenarios where this is inadvertently hiding functions, so maybe there needs to be a way to manually skip this check?
Steps to Reproduce
Fix the NameShadowing setType class and the test cases will fail.
changed the title [-]public set of private var shouldn't be eliminated[/-][+]Kotlin: public set of private var shouldn't be eliminated[/+]on Aug 24, 2023
Activity
[-]public set of private var shouldn't be eliminated[/-][+]Kotlin: public set of private var shouldn't be eliminated[/+][Xamarin.Android.Tools.Bytecode] Kotlin internal prop visibility (#1151)
Bump to xamarin/java.interop/main@1adb7964
Bump to xamarin/java.interop/main@38c8a827 (#8339)
[Xamarin.Android.Tools.Bytecode] Kotlin internal prop visibility (#1151)
[Xamarin.Android.Tools.Bytecode] Kotlin internal prop visibility (#1151)