Open vsuharnikov opened 8 years ago
For example, we have a JS object:
window.foo = { id: 1 name: "foo" };
If we try to get "id" as String (it actually is Int):
// ref points to foo ref.get[String]("id") onComplete { case x => println(x) }
nothing will happen. It seems that the error is in "unpackArg" method:
def unpackArg[A](arg: Any): A = arg match { // … case otherwise ⇒ val r = platformDependentUnpack(otherwise) r.asInstanceOf[A] // Here }
unpackArg should return Try[A] and, namely, Failure, if it can't cast the value to a type A.
unpackArg
Try[A]
Failure
A
But i can't to fix it and check a solution, because the current develop branch is simply not working. So, i've created an issue.
For example, we have a JS object:
If we try to get "id" as String (it actually is Int):
nothing will happen. It seems that the error is in "unpackArg" method:
unpackArg
should returnTry[A]
and, namely,Failure
, if it can't cast the value to a typeA
.But i can't to fix it and check a solution, because the current develop branch is simply not working. So, i've created an issue.