diff options
author | Ludovic Courtès <ludo@gnu.org> | 2021-05-01 23:12:17 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-05-02 01:20:19 +0200 |
commit | 5969490f55e5a167a3eb2573a3c5241c0ce079f3 (patch) | |
tree | c42599676e193eaf5773b6418c14f41c5ad7b3b6 /module/language | |
parent | 81094013be65fe01b372af2b6eec1bc16462e99b (diff) | |
download | guile-5969490f55e5a167a3eb2573a3c5241c0ce079f3.tar.gz |
analyze: 'unbound-variable' warning handles re-exported bindings.
Fixes <https://bugs.gnu.org/47031>.
* module/language/tree-il/analyze.scm (make-use-before-definition-analysis)
[resolve]: Add case for when NAME is re-exported by MOD.
* test-suite/tests/tree-il.test ("warnings")["re-exported binding"]: New test.
Diffstat (limited to 'module/language')
-rw-r--r-- | module/language/tree-il/analyze.scm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/module/language/tree-il/analyze.scm b/module/language/tree-il/analyze.scm index 766568f38..1567e3ec5 100644 --- a/module/language/tree-il/analyze.scm +++ b/module/language/tree-il/analyze.scm @@ -510,6 +510,11 @@ given `tree-il' element." ;; The variable is an import. At the time of use, the ;; name is bound to the import. 'import) + ((and=> (module-public-interface mod) + (lambda (interface) + (module-variable interface name))) + ;; The variable is re-exported from another module. + 'import) (else ;; Variable unbound in the module. 'unbound)))))) |