You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class J {
public static void setClass(Class<? extends java.util.List> clazz) {
System.out.println(clazz.getName());
}
}
Then, in Scala REPL, the following type error occurs:
scala> J.setClass(classOf[java.util.ArrayList[]])
:8: error: type mismatch;
found : java.lang.Classjava.util.ArrayList[_]
required: java.lang.Class[ <: java.util.List]
J.setClass(classOf[java.util.ArrayList[_]])
It seems that "Class<? extends java.util.List>" is typed as "Class[_ <: java.util.List]" instead of "Class[_ <: java.util.List[_]]".
And scalac reports the same error.
In Scala 2.8.1.final, This error doesn't occur.
The text was updated successfully, but these errors were encountered:
The folowing Java code compiles.
public class J {
public static void setClass(Class<? extends java.util.List> clazz) {
System.out.println(clazz.getName());
}
}
Then, in Scala REPL, the following type error occurs:
scala> J.setClass(classOf[java.util.ArrayList[]])
:8: error: type mismatch;
found : java.lang.Classjava.util.ArrayList[_]
required: java.lang.Class[ <: java.util.List]
J.setClass(classOf[java.util.ArrayList[_]])
It seems that "Class<? extends java.util.List>" is typed as "Class[_ <: java.util.List]" instead of "Class[_ <: java.util.List[_]]".
And scalac reports the same error.
In Scala 2.8.1.final, This error doesn't occur.
The text was updated successfully, but these errors were encountered: