#1252 java.lang.Float? problem

DanielFath Sat 9 Oct 2010

I'm getting this weird error [java]java.lang::Float? is not assignable to sys::Float? To what can I assign java.lang::Float? and is there any way I can convert it to sys::Float?

brian Sat 9 Oct 2010

Remember that sys::Float is mapped to double/java.lang.Double.

So if you have a java.lang.Float, you probably need to call toDouble

DanielFath Sat 9 Oct 2010

Thanks, forgot about that one. That reminds me, I need to call a method that takes an Int

//java 
class Foo {... setSomeInt(Integer int) }

//fantom
Foo.setSomeInt(32) //Invalid args setSomeInt(sys::Int) 

//correct in fantom
Foo.setSomeInt(Integer(32))

I understand I'm trying to map Long to Integer but is there some way for it to pass?

Update: Nvm, figured it out though I thought that sys::Int would automatically map to Integer.

Login or Signup to reply.