-
Notifications
You must be signed in to change notification settings - Fork 21
Reflection: cannot invoke a method that takes a value class parameter #6411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6411?orig=1 |
@paulp said: class X[T](val i: T) extends AnyVal
object a {
def y[T](x: X[T]) = x.i
}
object Test {
def main(args: Array[String]) {
val cm = scala.reflect.runtime.currentMirror
val moduleA = cm.reflect(a)
val methodY = moduleA.symbol.typeSignature.declarations.last.asMethod
val m = moduleA.reflectMethod(methodY)
m(new X(0))
// java.lang.NoClassDefFoundError: no Java class corresponding to ErasedValueType(X[T]) found
// at scala.reflect.runtime.JavaMirrors$JavaMirror.typeToJavaClass(JavaMirrors.scala:1225)
// at scala.reflect.runtime.JavaMirrors$JavaMirror$$anonfun$methodToJava$1$$anonfun$27.apply(JavaMirrors.scala:1192)
// at scala.reflect.runtime.JavaMirrors$JavaMirror$$anonfun$methodToJava$1$$anonfun$27.apply(JavaMirrors.scala:1192)
}
} |
@xeno-by said: |
@adriaanm said: |
@xeno-by said: |
@xeno-by said: |
@xeno-by said (edited on Feb 4, 2013 10:26:52 PM UTC): |
@xeno-by said: |
The text was updated successfully, but these errors were encountered: