bugKawa - Bugs: bug #39209, failing member lookup from...


bug #39209: failing member lookup from inherited not-yet-compiled class

Submitted by:  Per Bothner <bothner>
Submitted on:  Sat 08 Jun 2013 11:26:31 PM UTC  
Category:  Scheme language Severity:  3 - Normal
Item Group:  None Status:  Confirmed
Privacy:  Public Assigned to:  Per Bothner <bothner>
Open/Closed:  Open

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Sat 08 Jun 2013 11:26:31 PM UTC, original submission:


(define-simple-class Base ()
((foo) ::java.lang.String #!abstract)
((bar x)
(if x (foo) "ab")))

(define (create-simple) ::Base
(object (Base)
(bar #f))))

(let ((simple ::Base (create-simple)))
(format #t "~a~%" (invoke simple 'foo)))

Line-by line evaluation works:

$ kawa -f meth.scm

Whole-module evaluation doesn't:

$ kawa meth.scm
/home/bothner/tmp/meth.scm:9:6: warning - no declaration seen for bar
/home/bothner/tmp/meth.scm:9:6: unbound location bar
at gnu.mapping.SharedLocation.get(SharedLocation.java:22)
at gnu.mapping.ThreadLocation.get(ThreadLocation.java:105)
at meth$0.foo(meth.scm:9)
at meth.run(meth.scm:12)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:309)
at gnu.expr.CompiledModule.evalModule(CompiledModule.java:41)
at gnu.expr.CompiledModule.evalModule(CompiledModule.java:60)
at kawa.Shell.runFile(Shell.java:497)
at kawa.Shell.runFileOrClass(Shell.java:420)
at kawa.repl.main(repl.java:874)

The problem is the name lookup in Translator#rewrite that searches for in-scope matching members. It uses SlotGet#lookupMember. However, this doesn't work on the class Base, because the members are created by ClassExp#declareParts, which doesn't been evaluated yet.

A solution is to search Base's ClassExp for a matching Declaration. Another is to do (appropriate bits of) declareParts earlier.

Per Bothner <bothner>
Project AdministratorIn charge of this item.


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by bothner (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    No changes have been made to this item

    Back to the top

    Powered by Savane 3.4