Following code, that should be legal:
new TableColumn[Person, Circle] {
text = "Color"
cellFactory = {
e => new TableCell[Person, Circle] {
graphic = new Circle {fill = Color.GREEN; radius = 8}
}
}
produces compilation error:
polymorphic expression cannot be instantiated to expected type;
found : [S, T]javafx.scene.control.TableCell[Nothing,Nothing]
required: javafx.scene.control.TableCell[scalafx.controls.tableview.Person,scalafx.scene.shape.Circle]
Note: Nothing <: scalafx.controls.tableview.Person (and [S,
T]javafx.scene.control.TableCell[Nothing,Nothing] <:
javafx.scene.control.TableCell[Nothing,Nothing]), but Java-defined class
TableCell is invariant in type S.
You may wish to investigate a wildcard type such as `_ <:
scalafx.controls.tableview.Person`. (SLS 3.2.10)
Note: Nothing <: scalafx.scene.shape.Circle (and [S,
T]javafx.scene.control.TableCell[Nothing,Nothing] <:
javafx.scene.control.TableCell[Nothing,Nothing]), but Java-defined class
TableCell is invariant in type T.
You may wish to investigate a wildcard type such as `_ <:
scalafx.scene.shape.Circle`. (SLS 3.2.10)
cellFactory = { e => new TableCell[Person, Circle] {
^
Original issue reported on code.google.com by jpsacha on 8 Nov 2013 at 2:54
Original issue reported on code.google.com by
jpsacha
on 8 Nov 2013 at 2:54