Kev
10/17/2023, 2:14 PMdata class ApplicationError(val cause: ApplicationError?)
, is there a neat way to flattern this which my potentially be something like val cause = error.cause.cause.cause.cause.cause.cause.cause.cause
illustrating how long the chain may beYoussef Shoaib [MOD]
10/17/2023, 3:04 PMtailrec fun ApplicationError.rootCause(): ApplicationError? = cause?.rootCause()
Davio
10/17/2023, 4:03 PMval
was a var
then yes, there could potentially be a loop.Kev
10/17/2023, 4:04 PMYoussef Shoaib [MOD]
10/17/2023, 4:06 PM