https://kotlinlang.org logo
#ios
Title
# ios
r

ribesg

11/17/2020, 2:35 PM
Original ObjC/Swift `var`: https://developer.apple.com/documentation/foundation/nsexception/1412165-callstackreturnaddresses Generated Kotlin code:
Copy code
public final val callStackReturnAddresses: kotlin.collections.List<*> /* compiled code */
    @kotlinx.cinterop.ObjCMethod public open external fun callStackReturnAddresses(): kotlin.collections.List<*> { /* compiled code */ }
- Why is the
val
final
? It isn’t in ObjC/Swift - Why is there an open function with the same name? Does overriding it overrides the
val
too? How does that work?
l

louiscad

11/18/2020, 2:20 AM
I think @svyatoslav.scherbina might be able to answer.
s

svyatoslav.scherbina

11/18/2020, 8:29 AM
- Why is there an open function with the same name? Does overriding it overrides the 
val
 too?
Yes. To override a
val
, you need to override its accessor(s).
callStackReturnAddresses()
is the getter.
👍 1