Avoid ignoring class/unit forms at the top-level

Possibly a better long-term solution (for after the release)
is to not use the ignore property here and instead just use the
ignore table.
This commit is contained in:
Asumu Takikawa 2015-10-20 18:34:46 -04:00
parent c3a59ee1c4
commit 5fa40de546
2 changed files with 16 additions and 2 deletions

View File

@ -65,8 +65,14 @@
(local-expand/capture* #'e 'top-level (kernel-form-identifier-list))))
(syntax-parse head-expanded
#:literal-sets (kernel-literals)
[(begin (define-values (n) _) ... (~or _:ignore^ _:ignore-some^))
#'e]
[(begin (define-values (n) _) ...
(~and (~or _:ignore^ _:ignore-some^)
(~not (~or _:tr:class^
_:tr:unit^
_:tr:unit:invoke^
_:tr:unit:compound^
_:tr:unit:from-context^))))
head-expanded]
;; keep trampolining on begins
[(begin (define-values (n) e-rhs) ... (begin e ... e-last))
#`(begin (tc-toplevel-trampoline orig-stx (define-values (n) e-rhs))

View File

@ -0,0 +1,8 @@
#lang racket/load
;; A test for GH issue #220
(require typed/racket)
(class object% (super-new) (+ 1 "foo"))
(unit (import) (export) (+ 1 "foo"))