From d014872716a97628c96cf50095237828d643b856 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Thu, 10 Oct 2019 07:47:24 +0200 Subject: [PATCH] Check if there _is_ a value or syntax binding before warning and declaring it undefined This unbreaks the build of CHICKEN itself, which "abuses" the possibility of having both a procedure and a define-inline version of the same procedure in tweaks.scm. --- core.scm | 3 ++- modules.scm | 15 ++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/core.scm b/core.scm index b3177501..b05a68b6 100644 --- a/core.scm +++ b/core.scm @@ -1043,7 +1043,8 @@ (lambda (id) (and (not (assq id foreign-variables)) (not (hash-table-ref inline-table id)) - (not (hash-table-ref constant-table id)))))) + (not (hash-table-ref constant-table id)) + (not (##sys#get id '##compiler#type-abbreviation)))))) (let ((il (or (assq name import-libraries) all-import-libraries))) (when il (emit-import-lib name il) diff --git a/modules.scm b/modules.scm index e9abd786..9bc8a0fa 100644 --- a/modules.scm +++ b/modules.scm @@ -470,11 +470,6 @@ (let* ((h (car xl)) (id (if (symbol? h) h (car h)))) (cond ((assq id sexports) (loop (cdr xl))) - ((not (check-export id)) - (set! missing #t) - (##sys#warn "exported identifier does not refer to value or syntax binding" - id) - (loop (cdr xl))) (else (cons (cons @@ -488,12 +483,14 @@ (cdr a)) ((not def) (set! missing #t) - (##sys#warn - (string-append + (##sys#warn + (string-append "exported identifier of module `" (symbol->string name) - "' has not been defined") - id) + (if (check-export id) + "' has not been defined" + "' does not refer to value or syntax binding")) + id) #f) (else (module-rename id name))))))) (loop (cdr xl)))))))))) -- 2.20.1