Commit Graph

712 Commits

Author SHA1 Message Date
Eric Dobson
8b1c643bca Consolidate the rest of the syntax properties in TR.
(cherry picked from commit 4310f04eaf)
2013-07-08 10:34:13 -04:00
Eric Dobson
7383a685e3 Centralized typechecker:ignore properties.
(cherry picked from commit a325e38046)
2013-07-08 10:34:13 -04:00
Eric Dobson
a945181907 Centralize the definition of the plambda syntax property.
(cherry picked from commit df07151cb9)
2013-07-08 10:34:13 -04:00
Asumu Takikawa
f0380177ca Refactor to reduce right-ward drift
(cherry picked from commit e0cff038c8)
2013-07-08 10:34:13 -04:00
Asumu Takikawa
a18bf85b4f Only generate poly contracts for functions
Closes PR 13815
(cherry picked from commit bafaf52056)
2013-07-08 10:34:12 -04:00
Asumu Takikawa
90b149dc46 Fix union merging
Trying to merge (and thus resolve) applications of struct
types would cause infinite looping on type instantiation
if the struct type used both a union and recursion.

Closes PR 13821
(cherry picked from commit c8e281a80e)
2013-07-08 10:34:12 -04:00
Vincent St-Amour
a45716f16e Fix type of gensym.
(cherry picked from commit c070aaecda)
2013-07-08 10:34:12 -04:00
Vincent St-Amour
fe96ba1516 Fix unsound unary fixnum subtraction optimization.
Closes PR13826.
(cherry picked from commit 93d4a5d426)
2013-07-08 10:34:12 -04:00
Vincent St-Amour
4e360f8bc3 Fix unsound fxquotient optimization.
Closes PR13827.
(cherry picked from commit 5e30416110)
2013-07-08 10:34:12 -04:00
Eric Dobson
d04ee6125a Make for loops in TR use an annotation when applicable.
(cherry picked from commit f6050d5587)
2013-07-08 10:34:12 -04:00
Sam Tobin-Hochstadt
d5c62424f8 Fix types of system etc for new keyword arguments.
This requires extending the ->optkey type constructor to support rest
arguments, and fixing the keyword function type generation code.

Testing is still limited because there's no parsing for such types.
That will be handled in a later commit.
(cherry picked from commit 3fd9df03f7)
2013-07-08 10:34:12 -04:00
Eric Dobson
0503bcd7c6 Move tc-literal to seperate file, as it doesn't belong in tc-expr.
(cherry picked from commit adbc516edf)
2013-07-08 10:34:11 -04:00
Sam Tobin-Hochstadt
d5f288e0c2 Register scoped type variables for internal def. annotations.
Closes PR 13793.
(cherry picked from commit 499bcefa1d)
2013-07-08 10:34:11 -04:00
Vincent St-Amour
c1dd497ba2 Don't splice in vector creation when optimizing vector-length.
Closes PR13788.
(cherry picked from commit d9264525bd)
2013-07-08 10:34:11 -04:00
Asumu Takikawa
11f7d8b452 Fix broken internal error
(cherry picked from commit e6503c5df6)
2013-07-08 10:34:11 -04:00
Eric Dobson
4f0af0de72 Make scoped type vars work only for explict Alls and annotations.
Solves major issue disscussed on PR 13586.
Closes PR 13622.
Solves issue when typechecking lambdas with types like (All (a) Any).
Closes PR 13596.
Closes PR 13539.
Closes PR 13703.
(cherry picked from commit 01a88f8db1)
2013-07-08 10:34:11 -04:00
Eric Dobson
ef66cb0ca7 Massive cleanup of requriements in TR.
(cherry picked from commit f332affa5a)
2013-07-08 10:34:11 -04:00
Eric Dobson
bd6baada71 Clean up lam-result.
Make drest a list instead of a pair, replace an int-err with a match error
which has source location, and remove static name for rest argument in error
case.
(cherry picked from commit 4fcda73adf)
2013-07-08 10:34:11 -04:00
Eric Dobson
4bae399d78 Cleanup tc-lambda-unit.
(cherry picked from commit 2a94ca9030)
2013-07-08 10:34:11 -04:00
Asumu Takikawa
a668c5d78b Add comments, purpose statements, and contracts
(cherry picked from commit bb2ecbf8cb)
2013-07-08 10:34:10 -04:00
Asumu Takikawa
f753e1b63f Document :type better
(cherry picked from commit a40a1341f6)
2013-07-08 10:34:10 -04:00
Asumu Takikawa
c2f5b31e96 Expend printing fuel in all branches
This makes (:type (Number -> Integer)) produce
(Number -> Integer) instead of expanding at the first name.
Combined with expansion cues, this makes it easier for users
to expand the relevant parts of types.
(cherry picked from commit 34aeaee672)
2013-07-08 10:34:10 -04:00
Asumu Takikawa
664a370a1b Cue user about unexpanded type aliases
This tells the user that more type aliases are
available for expansion. For example, (Listof Number)
has the alias Number still unexpanded into the union
that it represents.
(cherry picked from commit 19c5d3eaad)
2013-07-08 10:34:10 -04:00
Asumu Takikawa
6e94295c96 Add a #:verbose option to :type.
This prints the old way, expanding all aliases inside the type.
(cherry picked from commit 1f5b262f6d)
2013-07-08 10:34:10 -04:00
Asumu Takikawa
b35e0fd138 Cut off type printing with :type at one level
Makes types print nicer with :type in most cases.
Previously, the printer expanded type aliases as much
as possible. Now, it defaults to a single level of expansion.
A later commit adds a #:verbose option to show the entire
type.
(cherry picked from commit fd33584b6f)
2013-07-08 10:34:10 -04:00
Asumu Takikawa
b9a33acc66 Refactor and add purpose statements/contracts
(cherry picked from commit 64e1b68c8d)
2013-07-08 10:34:10 -04:00
Asumu Takikawa
691c156777 Fix parsing of (Struct ...) types.
This was a regression that appeared in 5.3.1
(cherry picked from commit 3eb4a75613)
2013-07-08 10:34:10 -04:00
Asumu Takikawa
4ccb8bf185 Fix regression for (begin) and simplify
(cherry picked from commit 23d39a9968)
2013-07-08 10:34:10 -04:00
Asumu Takikawa
d3a949a266 Avoid doing the 2nd pass twice at the top-level
Thanks to Eric for pointing this out.
(cherry picked from commit d7f29d3636)
2013-07-08 10:34:09 -04:00
Asumu Takikawa
ca2dd29aa6 Fix tc-toplevel-form for ignored syntax
(cherry picked from commit 2c042998b9)
2013-07-08 10:34:09 -04:00
Asumu Takikawa
fc8f39f7aa Make require/typed work at top-level
Closes PR 13747
(cherry picked from commit 67beb11cf6)
2013-07-08 10:34:09 -04:00
Vincent St-Amour
f042be8553 Fix source locations for TR for.
(cherry picked from commit 8638a661cc)
2013-07-08 10:34:09 -04:00
Asumu Takikawa
f59f57d444 Make define-type work at top-level
Closes PR 12913
(cherry picked from commit f3e6276f9b)
2013-07-08 10:34:09 -04:00
Vincent St-Amour
9c97902361 Fix type of sinh.
Found using random testing.
(cherry picked from commit 5de08f06b4)
2013-07-08 10:34:09 -04:00
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