Since these promises re-evaluate their bodies every time they
are forced, allowing them makes `force` not idempotent and not
safe to treat as a path.
This change is slightly backwards-incompatible, since programs
that previously passed `delay/name` promises across the typed
boundary will now fail at runtime. The alternative is also
incompatible: stop treating `force` as a path. Since `delay/name`
is quite obscure, this approach seems like the safer choice.
The `identifier-binding` function is now senstive to the "macro
introduction" scope that's on an indentifier provided to a currently
expanding macro. Unit tests for TR need to use
`syntax-local-intorduce` to remove it, in the same way that `tc-setup`
already does.
Also, recognize a class expansion when it's wrapped with
`#%expression`, since `class` now expands that way sometimes.
The `quote-syntax` form now suports a `#:local` option, which is
used for type annotations to preserve binding context.
Since `letrec-syntaxes+values` is now removed by `local-expand`,
some patterns must be adjusted, including the pattern used
for type annotations.
Using the enclosing module's context for the `#f` part of the
`(module* _ #f ....)` would generally enable a compact encoding of
bindings for the purposes of `module->namespace`. Disabling
`module->namespace` for the generated submodules seems more reliable,
and it seems unlikely that anyone will miss the extra debugging
capability (which is all that is lost for these submodules whose
content is, I think, unspecified).
This enables contract generation in the negative
direction (untyped->typed) for row polymorphic types
(basically mixin types).
Depends on `class-seal` and `class-unseal` in
the racket/class library.
This patch addresses two issues with `typed/racket/class`:
1. For multiple private fields declared with `define-values`, type
information does not propagate from the values produced by the
initialization expression to the declared fields. This breaks soundness
of private fields: A field can be annotated with a type that does not
contain the field's initial value.
This was resolved by keeping a table of temporary bindings introduced in
the expansion of the initializer along with their types. The field
setter's type is then checked against that of the corresponding
temporary.
2. The class body typechecker assumes that the `expr` of
a `define-values` clause will expand to a bare `(values vs ...)`.
This was resolved by generalizing the template for matching an expanded
`define-values` initializer and extracting the type information from the
`expr` instead of each element in `(vs ...)`.