GarouDan
10/02/2019, 5:37 PMabstract fun test() : String
can we, using somehow the new kotlin techniques to change the returning value of the function in the other abstract class which extend the first one, something like this?
fun test(): String {
return test().toString()
}
fun test(): Int {
}
The goal would be use to reuse the same name.
Maybe something using the by
keyword somehow? Composing the objects (where the problem here is that I have two abstract classes)Shawn
10/02/2019, 5:38 PMtest
method can take different parameters than specified in the parent class then sure, there’s nothing stopping you. Otherwise, no, what you’ve described is not possibleDiego Almeida de Oliveira
10/02/2019, 5:44 PMgenerics
karelpeeters
10/02/2019, 6:14 PMDiego Almeida de Oliveira
10/02/2019, 6:59 PMtest
functions have same signature,GarouDan
10/02/2019, 8:58 PMAlowaniak
10/02/2019, 9:13 PMStephan Schroeder
10/03/2019, 10:09 AMcovariant
keyword) is actually something that Dart has but Kotlin doesn’t https://dart.dev/guides/language/sound-problems#the-covariant-keyword