Hi,
I'm in a sort of catch-22 against the Scala compiler. I am overseeing something but can't find the way to satisfy the compiler...
I am trying to compile the basic "Hello World" of the RoboVM project, described here:
But I am using the Scala version found here:
My problem is with the line 37:
override def didFinishLaunching(application: UIApplication, launchOptions: NSDictionary) = {
For the record, NSDictionary is defined (as part of this framework, in Java) like this:
public class NSDictionary<K extends NSObject, V extends NSObject>
extends NSObject
implements Map<K, V> { ... }
Now, the different things I tried out and the compiler errors:
1) If I leave NSDictionary like that, the compiler says:
RoboTest.scala:37: error: class NSDictionary takes type parameters
2) If I change it to NSDictionary[NSObject, NSObject], or even NSDictionary[_, _] then:
RoboTest.scala:37: error: method didFinishLaunching overrides nothing.
Note: the super classes of class RoboTest contain the following, non final members named didFinishLaunching:
def didFinishLaunching(x$1: org.robovm.cocoatouch.uikit.UIApplication): Unit
def didFinishLaunching(x$1: org.robovm.cocoatouch.uikit.UIApplication,x$2: org.robovm.cocoatouch.foundation.NSDictionary): Boolean
3) If I remove the "override" and leave it like NSDictionary[NSObject, NSObject], then:
RoboTest.scala:37: error: name clash between defined and inherited member:
method didFinishLaunching:(application: org.robovm.cocoatouch.uikit.UIApplication, launchOptions: org.robovm.cocoatouch.foundation.NSDictionary[org.robovm.cocoatouch.foundation.NSObject, org.robovm.cocoatouch.foundation.NSObject])Boolean and
method didFinishLaunching:(x$1: org.robovm.cocoatouch.uikit.UIApplication, x$2: org.robovm.cocoatouch.foundation.NSDictionary)Boolean in class Adapter have same type after erasure: (application: org.robovm.cocoatouch.uikit.UIApplication, launchOptions: org.robovm.cocoatouch.foundation.NSDictionary)Boolean
How to satisfy the compiler in this case?
What is then the correct method signature for the Scala side, for line 37, given the Java definition?
Thanks in advance for any hints!
Sebastian