Skip to content

Instantly share code, notes, and snippets.

@dant3
Created August 4, 2017 12:38
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dant3/1c5f8ba8555cadb0c418523de7857e50 to your computer and use it in GitHub Desktop.
Save dant3/1c5f8ba8555cadb0c418523de7857e50 to your computer and use it in GitHub Desktop.
Check if kotlin generic is nullable type
inline fun <reified T> isNullable(): Boolean = null is T
@tieskedh
Copy link

haha, i was searching for a very complex function with reflection and stumbled upon this method.
It makes me feel dumb...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment