Hi everyone,
How can I validate an input for a function with lint check? For instance if a function should accept only integers >= 0 how can I put a lint check in the parameter?
z
Zan Skamljic
05/28/2021, 9:05 AM
try @IntRange annotation
s
Sergio C.
05/28/2021, 9:13 AM
error
This annotation is not applicable to target 'type usage'
Sergio C.
05/28/2021, 9:15 AM
Copy code
fun round(value: Double, @IntRange(from = 0, to = 10) places: Int = 0): Double {