Closed
Description
Mark Paluch opened DATAMONGO-2086 and commented
Kotlin extensions for ExecutableFindOperation
and ReactiveFindOperation
use the same generic type for the currently used type of the fluent API instance and the new (desired) type:
ReactiveFindOperation.FindWithProjection<T>.asType(resultType: KClass<T>): ReactiveFindOperation.FindWithQuery<T>
The left hand side should rather declare a wildcard to ignore the current type and only infer the desired target type:
ReactiveFindOperation.FindWithProjection<*>.asType(resultType: KClass<T>): ReactiveFindOperation.FindWithQuery<T>
to allow projections:
operations.query<Person>()
.asType<FirstnameOnly>()
.matching(query(where("firstname").isEqualTo("Walter")))
…
Affects: 2.1 RC2 (Lovelace), 2.0.10 (Kay SR10)
Referenced from: pull request #609
Backported to: 2.0.11 (Kay SR11)