In JFreeChart exists a class DefaultPieDataset which has methods:
``
public void setValue(java.lang.Comparable key, java.lang.Number value)
public void setValue(java.lang.Comparable key, double value)
Why does the following cases happen?
``
data.setValue(“Title”, 10.toDouble) // Does not compile
data.setValue(“Title” as java.lang.Comparable<String>, 10.toDouble) // OK
Also in the latter case, in the the cast, IDE gives a warning “This cast can never succeed” but code compiles and works correctly.