android / android/architecture-samples

toString doesn't override dataClass's tostring

Open
#809 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
45.8k
Forks
11.9k
PR merge metrics
No merged PRs in 30d

Description

The toString function in this class will never be called, at least I don't know where this would be called since this doesn't override the toString() from dataClasses:

```
sealed class Result {

data class Success(val data: T) : Result()
data class Error(val exception: Exception) : Result()
object Loading : Result()

override fun toString(): String {
return when (this) {
is Success<*> -> "Success[data=$data]"
is Error -> "Error[exception=$exception]"
Loading -> "Loading"
}
}
}
```

Contributor guide

Open the contributing guide

Research direction

Search the project for the shown Result sealed class and inspect how Kotlin data classes resolve toString. Check existing tests or usages for the intended output of Success, Error, and Loading; done when those instances use the intended string representation.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.