Tuesday, 22 October 2019

Compile time check while passing values to a function in Kotlin Android

I am taking a JSON file as input for a class and parsing the values using gson through respective data classes.

I want to call a function that takes a String value as an argument.

The string value allowed is decided from the values parsed from JSON file. Can I somehow check for that string value passed to the function at compile-time & give an error at compile-time?

Or If I can allow only certain values in the argument for the function based on the values from JSON



from Compile time check while passing values to a function in Kotlin Android

No comments:

Post a Comment