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]
Other format: [Raw text]

Verifier error using define-simple-class


Hello,

I'm using a recent CVS pull of Kawa and I'm getting verifier errors in some circumstances. I've attached a distilled example.

It seems to revolve around having a define-simple-class that generates a lambda that calls another method. Here's a snippet from the example:

--------------------
(define-simple-class <A> ()
  ((trouble)
   (let ((fn (lambda (o)
               (get-identity-property-name o))))
     fn))
  ...
  ((get-identity-property-name property-name)
   (string-append property-name "Identity")))
--------------------

The call to "get-identity-property-name" in the lambda seems to be the trigger. It's the compiled class, not the define-simple-class class, that gives the verifier error.

If I replace the "trouble" method with this:

--------------------
  ((okay)
   (let ((fn (lambda (o)
               (invoke (this) 'get-identity-property-name o))))
     fn))
--------------------

the compiled class is clean.

Below I've pasted in what I see at the command line.

Dean


----------
% make PURE=1 default
rm -f *.class
CLASSPATH=.:~/kawa/cvs/kawa-pure-build/kawa-1.7.91.jar java kawa.repl --warn-undefined-variable --main -C classthis.scm
(compiling classthis.scm)
CLASSPATH=.:~/kawa/cvs/kawa-pure-build/kawa-1.7.91.jar java classthis
Exception in thread "main" java.lang.VerifyError: (class: classthis, method: lambda1fn signature: (Ljava/lang/Object;)Ljava/lang/Object;) Incompatible object argument for function call
make: *** [run] Error 1
----------
--- /dev/null	Tue Oct  7 04:48:06 2003
+++ classthis.scm	Thu Jun  9 16:40:26 2005
@@ -0,0 +1,15 @@
+(module-static #t)
+
+(define-simple-class <A> ()
+  ((trouble)
+   (let ((fn (lambda (o)
+               (get-identity-property-name o))))
+     fn))
+
+  ((okay)
+   (let ((fn (lambda (o)
+               (invoke (this) 'get-identity-property-name o))))
+     fn))
+
+  ((get-identity-property-name property-name)
+   (string-append property-name "Identity")))

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