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
The REPL shows that the implicit works and the exception gets thrown when trying to invoke toInt:
scala>vala= implicitly[Int=> { deftoInt:Int }]
a:Int=>AnyRef{deftoInt:Int} = <function1>
scala> a(1)
res1:AnyRef{deftoInt:Int} =1
scala> a(1).toInt
java.lang.NoSuchMethodException
at scala.runtime.BoxesRunTime.toInteger(UnknownSource)
at .<init>(<console>:9)
at .<clinit>(<console>:9)
at .<init>(<console>:11)
at .<clinit>(<console>)
at $print(<console>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:751)
at scala.tools.nsc.interpreter.IMain$Request$$anonfun$13.apply(IMain.scala:992)
at scala.tools.nsc.interpreter.Line.scala$tools$nsc$interpreter$Line$$runAndSetState(Line.scala:41)
at scala.tools.nsc.interpreter.Line$$anonfun$1.apply$mcV$sp(Line.scala:47)
at scala.tools.nsc.io.package$$anon$2.run(package.scala:19)
at java.lang.Thread.run(Thread.java:722)
The text was updated successfully, but these errors were encountered:
This issue originates here: http://stackoverflow.com/questions/8422690/generic-method-convertible-to-structural-type-in-scala
Code to reproduce:
The REPL shows that the implicit works and the exception gets thrown when trying to invoke
toInt
:The text was updated successfully, but these errors were encountered: