Join Slack
Powered by
Why can't I specify return type of a function as R...
# getting-started
s
sjthn
06/03/2019, 5:59 PM
Why can't I specify return type of a function as Result. Something like this:
Copy code
fun fetchProducts(): Result<List<Product>> { }
IDE is erroring "kotlin.Result cannot be used as a return type"
t
thana
06/03/2019, 6:03 PM
https://stackoverflow.com/questions/52631827/why-cant-kotlin-result-be-used-as-a-return-type
s
sjthn
06/03/2019, 6:12 PM
thank you
t
Tom Adam
06/03/2019, 6:52 PM
Well, you might write your own Result class if needed. Or start using Arrow right away. 🙂
5
Views
Open in Slack
Previous
Next