I'm trying to retrieve a field containing an array of Double from MongoDB, but I'm receiving a
ClassCastException: List element cannot be cast to double.
The class is written in Kotlin, and the part of the code that produces the exception is:
val coordinates = doc.getList(FIELD_COORDINATES, Double::class.java)
This works:
val coordinates = doc.get(FIELD_COORDINATES) as List<Double>
And the equivalent code in Java works too:
final List<Double> coordinates = doc.getList(FIELD_COORDINATES, Double.class);
Please let me know if this is a bug in Kotlin or there's a mistake in my code.
