Skip to content

Instantly share code, notes, and snippets.

@sajjadyousefnia
Created March 21, 2019 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sajjadyousefnia/fd138e00976c43a9ad1d157ece77d966 to your computer and use it in GitHub Desktop.
Save sajjadyousefnia/fd138e00976c43a9ad1d157ece77d966 to your computer and use it in GitHub Desktop.
inline fun <reified T> isA(value: Any) = value is T
>>> println(isA<String>("abc"))
true
>>> println(isA<String>(123))
false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment