The contract now has two major differences:
- It raises an error when it would have to wrap.
- It uses chaperones to delay errors as long as possible
In general, using `Any` as a type when exporting to untyped
code will now just work, unless the untyped code tries to
communicate values back to the typed side, in which case an
immediate error will be raised.
Much of the implementation comes from the membrane design
from [Strickland et al, OOPSLA 2012].
Split out base-abbrev.rkt so that subtype is not dependent on abbrev.rkt.
Remove unused code in numeric-tower.rkt so that it is now a dependent of
abbrev.rkt, which allows the body of convenience.rkt to be merged back in.
Remove special casing for union.rkt and extraneous subtyping checks.
Remove union-maker.
Added a couple of contracts and fixed some others up as well.
The two bugs were that with-contract was not imported, and that
subtype could be called with Values and Results.
- Allow indexing into a VectorTop, with result `Any`.
- Don't use special typing rules for applications when the operator
has an annotation or instantiation.
Closes PR 12887.
Closes PR 12888.
Each typed module now defines a submodule named `type-decl`.
This module performs the type environment initialization (along
with other environment updates) when invoked. Additionall,
every typed module, when invoked, performs a for-syntax addition
to a list specifying the submodules that need invocation.
This invocation is then performed by the `#%module-begin` from
Typed Racket.
The `type-decl` module always goes at the beginning of the
expanded module, so that it's available at syntax-time for all
the other submodules. This involved adding pre- and post-
syntaxes for the results of typechecking.
This allows significant runtime dependency reduction from the
main `typed/racket` and `typed/racket/base` languages (not yet
complete).
Types for nan?, infinite?, pi.f, exact-round, exact-floor, exact-ceiling,
exact-truncate, degrees->radians, radians->degrees
Extended tc-random-testing: generates exact integers and rationals now
Fixed types of sinh, cosh and tanh to account for underflow and NaNs
Caveats:
- keyword function definitions do not define static
bindings, thus limiting optimization opportunities
- can't use `define:`, `lambda:`, etc with keywords
- error messages sometimes expose the implementation
- the optimizer skips most of the generated code for
keyword functions definitions (user-level code is
optimized)