https://kotlinlang.org logo
#getting-started
Title
# getting-started
r

René

04/27/2022, 7:08 AM
I’m extending a java class where I would like to override the getter/setter as properties is that really not possible?
Copy code
class Sample<T> {
  @Nullable
  public T getValue() {...}
  protected void setValue(T value) {...}
  //...
}
That is the simplified base class I had in mind something like:
Copy code
class Foo<T> : Sample<T>() {
  override val `value`: T
    get() {...}
    set(value) {...}
}
Well the different visibility modifier won’t make it easier ether…
I’m wondering if this is related: https://youtrack.jetbrains.com/issue/KT-31420
r

René

04/27/2022, 7:32 AM
I just found this bug too 😄
@ephemient so in short that is not possible
e

ephemient

04/27/2022, 7:40 AM
tl;dr yes, currently not possible
2 Views