This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Verifier error when passing untyped variable as boolean parameter
- To: kawa at sourceware dot cygnus dot com
- Subject: Verifier error when passing untyped variable as boolean parameter
- From: Jocelyn Paine <popx at pop3 dot ifs dot org dot uk>
- Date: Sat, 15 Sep 2001 19:15:25 +0100 (GMT)
A verifier error occurs when using the code below which passes an untyped
variable to a function which expects a boolean. Put into a static module,
the code compiles without reporting an error. However, when I require the
module, it fails with the error shown:
(define (make-boolean-literal (boolean <boolean>)) <list>
(list 'boolean boolean)
)
(define (make-literal value) <list>
(cond
((boolean? value)
(make-boolean-literal value)
)
(else
(format #t "Illegal value: ~A~%" value)
)
)
)
On requiring:
java.lang.VerifyError: (class: kb7/mm3/general/test, method: makeLiteral signature:
(Ljava/lang/Object;)Lgnu/lists/LList;) Expecting to find integer on stack
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:124)
at gnu.bytecode.ObjectType.getReflectClass(ObjectType.java:54)
at gnu.bytecode.ClassType.getModifiers(ClassType.java:66)
at gnu.bytecode.ClassType.isInterface(ClassType.java:160)
at gnu.bytecode.ClassType.compare(ClassType.java:721)
at gnu.bytecode.Type.isSubtype(Type.java:280)
at kawa.standard.require.scanForDefinitions(Compiled Code)
at kawa.lang.Translator.scan_form(Translator.java:467)
at kawa.lang.Translator.scan_body(Compiled Code)
at kawa.standard.Scheme.makeModuleExp(Scheme.java:785)
at kawa.Shell.run(Compiled Code)
at kawa.Shell.run(Shell.java:35)
at kawa.repl.apply0(repl.java:27)
at gnu.mapping.Future.run(Future.java:59)
Perhaps this, and one or two other errors I've reported with booleans, are
related to the fact that Scheme treats booleans in a funny way, taking any
non-#f value in a condition to be true?
Jocelyn Paine
http://www.ifs.org.uk/~popx/
+44 (0)7768 534 091