This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

static method problem


With Kawa 1.6.70, if I enter interactively this form:

(invoke-static <javax.swing.JOptionPane> 'showMessageDialog
	       #!null "blah blah" "title"
	       (static-field <javax.swing.JOptionPane> 'ERROR_MESSAGE))

it works as expected.

But if I define a funcion using it:

(define (swing:error-dialog (str :: <string>))
  (invoke-static  <javax.swing.JOptionPane> 'showMessageDialog
		  #!null str "title"
		  (static-field <javax.swing.JOptionPane> 'ERROR_MESSAGE)))

I get this error:

Exception in thread "main" java.lang.VerifyError: (class: atInteractiveLevel, method: swing$ClErrorDialog signature: (Lgnu/kawa/util/FString;)Ljava/lang/Object;) Expecting to find object/array on stack
	at java.lang.ClassLoader.resolveClass0(Native Method)
	at java.lang.ClassLoader.resolveClass(ClassLoader.java, Compiled Code)
	at gnu.bytecode.ArrayClassLoader.loadClass(ArrayClassLoader.java, Compiled Code)
	at gnu.expr.LambdaExp.evalToClass(LambdaExp.java, Compiled Code)
	at gnu.expr.LambdaExp.eval(LambdaExp.java, Compiled Code)
	at gnu.expr.ModuleExp.evalModule(ModuleExp.java, Compiled Code)
	at kawa.Shell.run(Shell.java, Compiled Code)
	at kawa.Shell.run(Shell.java, Compiled Code)
	at kawa.Shell.run(Shell.java, Compiled Code)
	at kawa.repl.main(repl.java, Compiled Code)

Turning the procedure in a macro works in "interpreted mode" but if I
try to compile it I get this error:

<unknown>:0: Literals: Internal error:java.lang.NullPointerException
java.lang.NullPointerException
	at gnu.expr.LitTable.writeObject(LitTable.java, Compiled Code)
	at gnu.expr.LitTable.writeObject(LitTable.java, Compiled Code)
	at kawa.lang.SyntaxRule.writeExternal(SyntaxRule.java, Compiled Code)
	at gnu.expr.LitTable.writeObject(LitTable.java, Compiled Code)
	at gnu.expr.LitTable.writeObject(LitTable.java, Compiled Code)
	at kawa.lang.SyntaxRules.writeExternal(SyntaxRules.java, Compiled Code)
	at gnu.expr.LitTable.writeObject(LitTable.java, Compiled Code)
	at kawa.lang.Macro.writeExternal(Macro.java, Compiled Code)
	at gnu.expr.LitTable.writeObject(LitTable.java, Compiled Code)
	at gnu.expr.LitTable.emit(LitTable.java, Compiled Code)
	at gnu.expr.Literal.emit(Literal.java, Compiled Code)
	at gnu.expr.Compilation.addClass(Compilation.java, Compiled Code)
	at gnu.expr.Compilation.<init>(Compilation.java, Compiled Code)
	at gnu.expr.ModuleExp.compileToFiles(ModuleExp.java, Compiled Code)
	at kawa.lang.CompileFile.compile_to_files(CompileFile.java, Compiled Code)
	at kawa.repl.main(repl.java, Compiled Code)

Looks like a bug to me, but I might be missing something basic.

-- 
walter pelissero
http://www.pelissero.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]