Type parameter ignored in selectDynamic invocation #6663
As noticed by Dinko Srkoc in http://thread.gmane.org/gmane.comp.lang.scala.user/58246 sometimes the type parameter on a selectDynamic call gets lost.
With this definition:
one gets this behaviour:
This happens because in Typers.scala, mkInvoke is called with the following cxTree:
Note that the outer element of that tree is a Select(..., "get"), and that's not handled by mkInvoke:
That can be fixed by adding another case:
With that change, the examples work as expected:
The text was updated successfully, but these errors were encountered:
Jan Niehusmann (jannic) said:
scala> new C(42).foo[String].get java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String scala> new C(42).foo[String].get : Int res2: Int = 42
Here, the [String] parameter is ignored, again. This time because the cxTree starts with the type annotation: (new C.(42).foo[String].get: Int)
Is there an easy way to find everything which can possibly get attached to cxTree?