fix bug when importing bindings that were already imported and used
authorAndy Wingo <wingo@pobox.com>
Wed, 7 Apr 2010 22:29:52 +0000 (00:29 +0200)
committerAndy Wingo <wingo@pobox.com>
Wed, 7 Apr 2010 22:29:52 +0000 (00:29 +0200)
* module/ice-9/boot-9.scm (module-use!, module-use-interfaces!): When
  adding the module or interface to the use list, clear the cached
  imports obarray.

  The test case is coming next.

module/ice-9/boot-9.scm

index f549393..f0877b7 100644 (file)
@@ -1978,7 +1978,7 @@ If there is no handler at all, Guile prints an error and then exits."
                                                      (module-name interface))))
                                           (module-uses module))
                                   (list interface)))
-
+        (hash-clear! (module-import-obarray module))
         (module-modified module))))
 
 ;; MODULE-USE-INTERFACES! module interfaces
@@ -1988,6 +1988,7 @@ If there is no handler at all, Guile prints an error and then exits."
 (define (module-use-interfaces! module interfaces)
   (set-module-uses! module
                     (append (module-uses module) interfaces))
+  (hash-clear! (module-import-obarray module))
   (module-modified module))
 
 \f