Extending Java classes - puzzler
brian
29 Jun 2012
That might be a bug, @geo do you have a small test case that doesn't require the whole fx thing? If so please email and lets work offline to investigate
geo
30 Jun 2012
I think I have figured this out, it's not a problem with Fantom, it the fact that JavaFX creates instances of Application via reflection using the default (no params) constructor. I will have to think of another way to inject "params".
geo
30 Jun 2012
This raises the question, is there a way to convert a Fantom Type to a Java Class at runtime?
geo
2 Jul 2012
Would it be possible to have a method qnameNative on Type that returns the qualified name of the type as it would be on the platform as a Str?
e.g in Java
If you had a pod called MyPod, with a class called MyClass the equivalent Java class would (I believe) be fan.MyPod.MyClass
That way you could pass the Str to your Java code and use Class.forName(name) to work with it!
brian
2 Jul 2012
You can use ->toClass to get Java class off Type:
fansh> OutStream#->toClass class fan.sys.OutStream
geo
28 Jun 2012
If I extend a Java class that has a default (no arg) constructor, and my Fantom sub-class also has a simple no arg default constructor
new make():super(){}I am able to instantiate an instance of my Fantom class.But, if I want my Fantom sub-class to take arguments in its constructor
new make(Str s) : super(){echo(s)}and still call the default super constructor why do I get an exception when I try to instantiate an instance of my Fantom class?Applicationis the Java class that I am extending, andTestAppis the sub-class