Closed lemvik closed 3 years ago
Sorry, forgot to mention build details:
Linux 5.8.0-40-generic #45-Ubuntu SMP Fri Jan 15 11:05:36 UTC 2021 x86_64
Thanks for the report! I'm able to replicate the problem, and I'll continue to investigate.
The problem is in a change to cross-library inlining that I added to cp0. Here's a somewhat simpler example:
(library (test)
(export a b am bm)
(import (rnrs))
(define-syntax def
(syntax-rules ()
[(_ id idm)
(begin
(define (helper x) (if (zero? x) 'id (helper (- x 1))))
(define (id x) (helper x))
;; causes `helper` to be preserved:
(define-syntax idm (syntax-rules () [(_) helper])))]))
(def a am)
(def b bm))
(import (test))
(a 10)
(b 10)
In the optimization of (a 10)
, an inlined reference to helper
ends up referring to the wrong helper
, because identifier names are not compared the right way when inlining.
Hi!
There seems to be a regression in the Racket fork of Chez Scheme related to
define-condition-type
and library export forms.Minimal example
conditions-evaluation.scm
:In base Chez branch:
in Racket branch:
So strangely
for-all
returns true but when conditions are checked individually some of them fail the check.Surprisingly the problem disappears if I remove the export of
&second-derived-condition
or if I add the export of&base-condition
.