Is there a way to check if generic type parameters...
# announcements
m
Is there a way to check if generic type parameters are nullable? Like this:
Copy code
inline fun <reified Key, reified Value> makeSomeMap(): Map<Key, Value> =
	if (Key::isNullable) 
		if (Value::isNullable) 
			makeSomeMapWithNullableKeyAndValue()
		else
			makeSomeMapWithNullableKey()
	else
		if (Value::isNullable)
			makeSomeMapWithNullableValue()
		else
			makeSomeMapWithoutNulls()
i.e. different logic depending on nullability.