Describe the bug
DataFetchingEnvironment.getDataLoader<K, V>() has type parameters that are implicitly non-null due to @NullMarked but DataLoader<K, V extends @Nullable Object> explicitly allows nullable V. This creates a type mismatch when calling from Kotlin. As of Kotlin 2.1.0, Kotlin compiler treats JSpecify types as null-safe types.
To Reproduce
From Kotlin, attempt to get a DataLoader with a nullable value type:
// Kotlin sees getDataLoader as requiring V : Any
val loader: DataLoader<String, Player?>? = env.getDataLoader("PlayerLoader")
// Error: Type argument is not within its bounds: must be subtype of 'Any'