This broke when I made the printing lazier using thunks.
Also use regexps for the tooltip tests.
original commit: 8bff995f41be53c119d4d09cb802b1f8c8f5c714
The use of case-> can cause an expression to get
typechecked multiple times, so the tooltips should reflect
all of the passes.
original commit: c170b8288c74dfd227f90897c4f65979a006cb68
Macros often expand into forms where the subforms have
the same syntax location as the entire form, which means
a naive approach gives confusing type tooltips on macro
expressions.
Instead, only keep the latest (outermost) type tooltip
for a given expression.
We could instead compute whether a given piece of syntax
is a subform of another at a given location or not, but
that check is expensive and we don't want to do that on
every update of the type table.
original commit: c2abbc700d6b8233e4a52f518d8056579d696b5f
Needs a real fix in the future to actually support this case.
Noted in a program from Matthias Felleisen.
Fixes PR 14841.
original commit: a64dadc78c54fc04bfa8ac8ae9649f4178f0ae25
This commit uses memoization not just for Name types
but for static contracts for all types. It also adjusts
how Name contracts are generated to increase sharing
across multiple type->contract calls.
original commit: 18c1f095fcf47e0b935819ecb0c3f2b7a3e7fec1
This was used for the old method of generating contracts
for these types but is no longer necessary.
original commit: 4d46985e58a0eb9ebe7cbe45063b6a28938df067
Don't export type->contract except for testing. This
discourages direct use of type->contract in favor of
using the change-contract-fixup approach.
Also consolidate most of the contract-related syntax
properties into a single property containing a prefab
struct instance.
original commit: b374902bf3dd24e06f64017aa3d89e29ec6ffd42
Eliminates the last remaining use of type->contract
outside of the type-contract.rkt file. This allows
all contract generation to go through a single point
of control.
original commit: 7b6ae09a2dcf04a5755f6f9256ff82369cc52403
Add expt to random testing.
Haven't seen one of those bugs in a while. Thank you Redex.
Closes PR14823.
original commit: 8b8130c38e211128f735a640f199213c80580f71
Use the same mechanism as require/typed for doing all
contract gen for make-predicate, cast, etc. Also don't
special-case contract generation for top-level require/typed.
original commit: 1c5202ade74c922e7f3870c7bc3e505357a3ed85
This avoids the cost of computing the printed types
to some degree. It still does have overhead (~5%) over
not computing anything related to tooltips because of
the cost of traversing the type table and computing
tooltip locations.
original commit: 64bc7d4e859e84ce044fd7f72043e26218553c58
Typed Racket, as of 8ea8c54eb, can add explicit require lines
to the expanded module, which can confuse the dependency
analyzer. An explicit implies declaration avoids the problem,
although I'm not sure that this is the right solution.
original commit: 8582d94507ae6b2c3c710b6e244a037461bef0f7
This changes when various libraries that provide contract
support to possible contracted bindings to declare when
those bindings are needed.
Probably, each static-contract combinator should manually
add to the list, instead of having one fixed static list,
but this is a start.
Saves about 10ms in startup for an empty TR module on my
laptop.
Thanks to Robby for the idea.
original commit: 8ea8c54eb47faac7c0d8bcd868a9b12f8ea2e142
Instead of using a syntax-property hack, just disarm the
expanded syntax (TR will do this later in the pipeline anyway).
original commit: 375abf3c2b26b76044a63c1e0d8bd16cc4f52a38
A public method definition and a private field that contains
a function are hard to distinguish without traversing the entire
class body, which caused TR to fail to detect the private field
case. TR now uses more compile-time state to precisely
distinguish the cases.
Also fixes a related bug in which TR would incorrectly handle
multiple private fields defined with a single `define-values`.
Closes PR 14788
original commit: 670c8576851cb21e910778f913270a0752e7ede4