Commit Graph

678 Commits

Author SHA1 Message Date
Sam Tobin-Hochstadt
20f546110b Refactor subtype.rkt not to use exceptions.
Matthew suggests that using exceptions for failure
in the implementation of `subtype` is a performance
problem.  This commit removes all use of exceptions
for failure in subtype.rkt, replacing it with the
standard Racket #f/value option.

Extensive use is made of the `subtype-seq` form,
which is basically do-notation for the subtyping
monad.
(cherry picked from commit a6f110893f)
2013-07-08 10:34:09 -04:00
Eric Dobson
8483d0cd6f Minor cleanup in subtype.rkt
(cherry picked from commit b9c4582746)
2013-07-08 10:34:09 -04:00
Vincent St-Amour
bc34a73cd6 Fix type of tanh.
Found using random testing.
(cherry picked from commit 89f9b860cd)
2013-07-08 10:34:08 -04:00
Asumu Takikawa
07fca0974d Fix printing of tc-any-results in type errors.
In the long run, these error messages should get
simplified so that this printing is not necessary.

Closes PR 13577 and PR 13526
(cherry picked from commit e53b0858c3)
2013-07-08 10:34:08 -04:00
Asumu Takikawa
def0ec7c01 Fix docs for Opaque
Closes PR 13531
(cherry picked from commit 7c96321cd4)
2013-07-08 10:34:08 -04:00
Asumu Takikawa
f38129c741 Clean up struct: and disallow unsupported options
Related to PR 13562
(cherry picked from commit c3b80bee41)
2013-07-08 10:34:08 -04:00
Eric Dobson
a901650bab Fix contract generation for mutable structures.
(cherry picked from commit de96643fbe)
2013-07-08 10:34:08 -04:00
Eric Dobson
64d66d3b9a Make structs initialize to constant instead of covariant.
(cherry picked from commit 7735aa5799)
2013-07-08 10:34:08 -04:00
Eric Dobson
aa025b9c56 Cleanup names-of-struct
(cherry picked from commit 154ab046fe)
2013-07-08 10:34:08 -04:00
Vincent St-Amour
d9b680dbf5 Document VectorTop and HashTableTop.
(cherry picked from commit 457ca0982f)
2013-07-08 10:34:08 -04:00
Vincent St-Amour
b89aedb992 Allow read-only hash operations to accept HashTop.
Closes PR13710.
(cherry picked from commit e6ff57f3bd)
2013-07-08 10:34:07 -04:00
Eric Dobson
8d78a2a152 Make type->contract correctly respect variance.
Track whether we are protecting values from the typed side and/or the
untyped side.

Closes PR 13662.
Closes PR 13663.
Closes PR 13665.
(cherry picked from commit b5b13222c8)
2013-07-08 10:34:07 -04:00
Eric Dobson
67590cade8 Allow requiring functions with filters in contravariant positions.
(cherry picked from commit dbcb1414da)
2013-07-08 10:34:07 -04:00
Eric Dobson
9411b01e3f Switch out? to from-typed? as it has the same meaning.
(cherry picked from commit 03e1ffda3e)
2013-07-08 10:34:07 -04:00
Eric Dobson
52f892a5fd Fix subtyping of (ListDots t 'a) <: (Listof t).
Closes PR 13636.
(cherry picked from commit 6898a7c880)
2013-07-08 10:34:07 -04:00
Eric Dobson
d426867956 Fix expected type when typechecking map
(cherry picked from commit 863ac05332)
2013-07-08 10:34:07 -04:00
Eric Dobson
5345c1f7d3 Don't let map introduce type variables.
Closes PR 13581.
(cherry picked from commit 67dd956b6a)
2013-07-08 10:34:07 -04:00
Eric Dobson
e2f724fcd3 Use information of application site, to reduce possible arities.
Closes PR12905.
(cherry picked from commit 55aba088de)
2013-07-08 10:34:07 -04:00
Eric Dobson
15b1fa5486 Small TR fixes.
(cherry picked from commit a94c449ff1)
2013-07-08 10:34:07 -04:00
Eric Dobson
ffe487e324 Add polydots to all things that support it.
Closes PR 13612.
Closes PR 13584.
(cherry picked from commit 2e2ef0b57a)
2013-07-08 10:34:06 -04:00
Eric Dobson
eff170b33e Correctly protect Procedures in TR.
Closes PR 13664.
(cherry picked from commit fc36c12ce4)
2013-07-08 10:34:06 -04:00
Sam Tobin-Hochstadt
3590b9681e Add #:omit-define-syntaxes to define-type.
(cherry picked from commit ecf02a32b4)
2013-07-08 10:34:06 -04:00
Eric Dobson
5f34da6692 Terminate typechecking on cyclic lists.
Closes PR 13687.
(cherry picked from commit b8ab1334d9)
2013-07-08 10:34:06 -04:00
Stephen Chang
bfbba3f0bf fix typed racket named let: error when there are no binding types
closes PR 13691

include in release
(cherry picked from commit b3ba324a92)
2013-04-16 10:49:17 -04:00
Asumu Takikawa
9eaf5aaddb Remove unnecessary type->contract case 2013-04-05 16:56:50 -04:00
Asumu Takikawa
0161dfdf16 Translate Value types to ctcs with better names
e.g., True -> '#t  instead of
      True -> "#t" for a flat-named-contract
2013-04-05 16:56:50 -04:00
Vincent St-Amour
16a75761b0 Make TR-generated identifiers have the same name as original identifiers.
Makes error messages nicer, and makes it easier to correlate with source code.
2013-04-04 15:31:51 -04:00
Vincent St-Amour
ff3d785da2 Use locations from typed identifiers for type-generated contracts. 2013-04-04 15:31:51 -04:00
Vincent St-Amour
459c731bb9 Have Optimization Coach report unsound float division missed optimizations. 2013-04-04 15:31:50 -04:00
Eric Dobson
94861becd0 Fix untested contract generation code.
Closes PR 13449.
2013-04-04 08:29:15 -07:00
Eric Dobson
76de4d3cca Fix tc-apply to correctly generate expected ValueDots filters.
Closes PR 13649.
2013-04-04 07:45:15 -07:00
Eric Dobson
2b8efd6676 Fix contracts in TR. 2013-04-04 07:43:08 -07:00
Eric Dobson
17b9ed0a75 Fix prefix-of.
Closes PR 13448.
2013-04-04 07:42:45 -07:00
Eric Dobson
5ec7401f1f Add example of (List t ... bound).
Closes PR 11903.
2013-04-04 07:41:53 -07:00
Eric Dobson
c295608282 Add doc for #:no-optimize.
Closes PR 13001.
2013-04-04 07:41:53 -07:00
Vincent St-Amour
a50d9bad7e Avoid unsound optimization for complex division.
Found using random testing.
2013-04-04 10:05:53 -04:00
Eric Dobson
04ef9db1b3 Turn dynamic-requires into lazy-requires in TR.
Closes PR 13621.
2013-04-03 09:49:40 -07:00
Eric Dobson
6c2e75ac7e Make +,*,min,max support precise unary types.
Closes PR 13563.
2013-04-03 09:33:02 -07:00
Eric Dobson
0e0f1cd670 Adds subtyping for filters, and fixes -FS to be more precise.
Closes PR 12817.
2013-04-03 09:25:28 -07:00
Tony Garnock-Jones
c5df74f662 Show the offending value when a TR-introduced Any contract fails 2013-04-02 16:29:11 -04:00
Tony Garnock-Jones
f2616b934c Avoid stripping location information from syntax object in warning message. 2013-04-02 16:29:11 -04:00
Vincent St-Amour
b808d2809e Fix optimization on exp of complex numbers.
Found using random testing.
2013-04-02 16:29:11 -04:00
Vincent St-Amour
f66ee7088f Fix type of tanh.
Found using random testing.
2013-04-02 16:29:10 -04:00
Vincent St-Amour
ed12b64bf7 Fix type of sinh.
Found using random testing.
2013-04-02 16:29:09 -04:00
Vincent St-Amour
6e10dd6a4d Imitate untyped division more closely.
Found using random testing.
2013-04-02 16:29:08 -04:00
Vincent St-Amour
5f9bcbca49 Abstract unboxing of complex division. 2013-04-02 16:29:08 -04:00
Vincent St-Amour
ca63915693 Fix coercions from single-floats to floats.
Found using random testing.
2013-04-02 16:29:07 -04:00
Vincent St-Amour
77b89fab99 Reimplement unboxing of complex division.
Add special cases to be consistent with untyped Racket.

Found using random testing.
2013-04-02 16:29:06 -04:00
Eric Dobson
3d49087ea3 Fix parsing of dotted rest when there is an expected type.
Closes PR 13646.
2013-04-01 22:17:32 -07:00
Vincent St-Amour
c8c6341970 Simplify type. 2013-04-01 14:44:32 -04:00