D
daniel.w.gelder
Hi,
I'm in the process of writing a custom compiler for my own language
that will target the JVM. I'm just getting started but I've got a
ClassInfo file successfully streamed. I have a question for anyone who
knows.
Apparently I have to define my own constructor, even if it doesn't do
anything. I seem to need to define an <init> method with signature
"()V", otherwise myClass.newInstance() throws InstantiationException.
Anyway, there's nothing in <init> except a return statement. So I get
this exception:
java.lang.VerifyError: (class: Dan, method: <init> signature: ()V)
Constructor must call super() or this()
So apparently I have to call Object.<init>() too. Makes sense, but I
thought you could never call <init> yourself. Is there a trick here?
Thanks.
Dan
I'm in the process of writing a custom compiler for my own language
that will target the JVM. I'm just getting started but I've got a
ClassInfo file successfully streamed. I have a question for anyone who
knows.
Apparently I have to define my own constructor, even if it doesn't do
anything. I seem to need to define an <init> method with signature
"()V", otherwise myClass.newInstance() throws InstantiationException.
Anyway, there's nothing in <init> except a return statement. So I get
this exception:
java.lang.VerifyError: (class: Dan, method: <init> signature: ()V)
Constructor must call super() or this()
So apparently I have to call Object.<init>() too. Makes sense, but I
thought you could never call <init> yourself. Is there a trick here?
Thanks.
Dan