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]

Problem with synchronized


When I start Kawa 1.6.94 and I type the following in the interactive
interpreter :
(define w (make <java.awt.Point> 4 5))
(synchronized w
  (display (field w 'x)))

It works, but when typing :
(let ((w (make <java.awt.Point> 4 5)))
  (synchronized w
    (display (field w 'x))))

It crashes :
java.lang.Error: popType called with empty stack ClassType
atInteractiveLevel apply(gnu.mapping.CallContext)void
        at gnu.bytecode.CodeAttr.popType(CodeAttr.java:205)
        at gnu.bytecode.CodeAttr.emitStore(CodeAttr.java:877)
        at gnu.bytecode.CodeAttr.emitTryEnd(CodeAttr.java:1601)
        at gnu.expr.SynchronizedExp.compile(SynchronizedExp.java:40)
        at gnu.expr.Expression.compileNotePosition(Expression.java:60)
        at gnu.expr.Expression.compileWithPosition(Expression.java:47)
        at gnu.expr.LetExp.compile(LetExp.java:73)
        at gnu.expr.Expression.compileNotePosition(Expression.java:60)
        at gnu.expr.Expression.compileWithPosition(Expression.java:47)
        at gnu.expr.BeginExp.compile(BeginExp.java:80)
        at gnu.expr.Expression.compileWithPosition(Expression.java:50)
        at gnu.expr.LetExp.compile(LetExp.java:73)
        at gnu.expr.Expression.compileWithPosition(Expression.java:50)
        at gnu.expr.Compilation.addClass(Compilation.java:1152)
        at gnu.expr.Compilation.<init>(Compilation.java:631)
        at gnu.expr.ModuleExp.evalToClass(ModuleExp.java:70)
        at gnu.expr.ModuleExp.eval(ModuleExp.java:38)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:180)
        at kawa.Shell.run(Shell.java:93)
        at kawa.Shell.run(Shell.java:35)
        at kawa.repl.apply0(repl.java:27)
        at gnu.mapping.Future.run(Future.java:59)

It seems that synchronized dislike being enclosed in a let

Have fun...


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