Commit Graph

4119 Commits

Author SHA1 Message Date
Asumu Takikawa
8ef86fb139 Fix type->contract for recursive Name types
Certain mutually recursive Name types would generate
contracts that infinite loop when triggered.

original commit: 663e96afd6437bbb26866be1e8fbd9dfeb59582f
2014-03-15 16:35:41 -04:00
Eric Dobson
3c2e254693 Fix implied-atomic to work on -top and -bot.
original commit: 9e2787c0cf6eb3e45256ad31075978d3955ef34c
2014-03-14 18:55:24 -07:00
Eric Dobson
63bb9f5b5b Initial version of filter tests.
original commit: f7536ebfbd38e873039a98df000c347e5b10931c
2014-03-14 18:55:23 -07:00
Eric Dobson
95805cd035 Make check-below-tests check more things and give more debug info.
original commit: d9aeabdaec2e994df01d1434b05425f6ae7706cc
2014-03-14 18:22:31 -07:00
Asumu Takikawa
63c0e4c88c Adjust error messages for send typechecking
original commit: 2344a7683dfe74380f28bdcb852e9a0b83bab07a
2014-03-14 14:19:06 -04:00
Asumu Takikawa
2ecee7be45 Fix class typechecking for Name types
Fixed check-class-unit and get-field for the addition
of recursive Name types.

original commit: 32c78065a58633de2b884bb8d81b81ea86066aa8
2014-03-14 13:18:59 -04:00
Asumu Takikawa
b80597a56d Support rest args for TR class methods
original commit: 4439c9df0d5a367399bb92107954c9b47338c8af
2014-03-14 11:19:01 -04:00
Asumu Takikawa
f46e98bce9 Raise a better message for ctc generation in TR
This provides a better explanation of contract generation
failures for module-provided bindings.

original commit: 30b60f8c4369972f8fb98732149bd99ce8d9fd98
2014-03-14 10:05:54 -04:00
Eric Dobson
c806b3e35c Make check-below only accept arguments of the same kind.
original commit: 5600213a5a79d1106016f183d767cc17eee72d2b
2014-03-13 21:15:45 -07:00
Eric Dobson
dce4dd4ae9 Make users of check-below call it with same kind arguments.
original commit: 058b67946db65bf438db441db8639c6dc3fc5734
2014-03-13 18:50:36 -07:00
Eric Dobson
ccf7d79d27 Fix tc-results->values and filter-tc-results to handle polydots.
original commit: 88af96f19a340e4d6ac72a736456a3ec91354bc4
2014-03-12 19:05:19 -07:00
Asumu Takikawa
ef84da32f6 Change error messages for two TR unit tests
I'm not sure why, but these tests seem to emit one of two different
errors depending on the machine it's run on (hence the failure in
DrDr). For the short term, I've set the regular expression to allow
either of them.

original commit: e2e0ab748fdd99be105160e9a9706da970f0c5a2
2014-03-12 10:01:49 -04:00
Asumu Takikawa
fc00888943 Correctly check letrec-values clauses with no vars
Should unbreak the build, my apologies to bisecters

original commit: 36c3861494821c9efb1db9df278c77663e1ddb13
2014-03-12 01:18:16 -04:00
Asumu Takikawa
303f87c5eb Clarify a few comments in TR
These are for letrec typechecking and Tarjan's algorithm

original commit: 04c3851ebc1e7c78d314f833de1c76ab458202ed
2014-03-11 23:48:59 -04:00
Asumu Takikawa
07a8649e4d Use Tarjan's algorithm for typechecking letrecs
This allows us to type-check non-recursive sequences of
letrec-values clauses in the right order. In other words,
we will type-check the clauses in reverse topological
order (the reverse of the dependency order).

Clauses that are recursive go through the usual
type-checking process, injecting Undefined where necessary.

original commit: 93a2798ec3f41e113a282e10c31473d117f590e5
2014-03-11 23:03:39 -04:00
Asumu Takikawa
4f7bc4d5d3 Move TR's Tarjan's algorithm to a separate file
Also generalize so that it can be used in other
parts of the codebase.

original commit: 292a47c3dddbe4a311ad0133e992320d429f56b5
2014-03-11 23:03:39 -04:00
Asumu Takikawa
fbf9614f02 Improve letrec-values type-checking
Split into two passes in order to be able to find
more cases where the RHS doesn't refer to the bindings
in the letrec.

Closes PR 13124

original commit: bdb8833fa501a068f8fcebcf89cbf7c071a6c9c6
2014-03-11 23:03:39 -04:00
Asumu Takikawa
f90c6f92b0 Add type annotations for GUI libraries
The types for racket/gui are substantially complete, but
there are still some missing classes and methods.

Some interesting future work would be to ensure type coverage
by comparing the class members vs. the types in the environment.
That could be run as a test to ensure it stays up to date.

Most types for the framework library are still missing.

original commit: 00a3b7cb149ae35c63b9eb64df34d87424407a10
2014-03-11 17:39:02 -04:00
Asumu Takikawa
72e1cfc91b Make printing of Name types unfold correctly
original commit: 90dccbdffb3f5bf1de50cb1a6473f8492df517ff
2014-03-11 17:39:02 -04:00
Asumu Takikawa
d93ac7e2ff Add static contracts for instanceof
original commit: 4bc4a74d00b62522caaf0fd9a4d334e440d5a56b
2014-03-11 17:39:02 -04:00
Asumu Takikawa
8ff305e328 Add recursive type alias support to TR
This expands the `Name` type functionality to go
beyond struct names and allows arbitrary recursive
type aliases to use the environment for indirection.

In addition, such aliases can be mutually recursive.

original commit: a8cc430d0fc7090dd758e0f6738296edcb4d8490
2014-03-11 17:39:02 -04:00
Eric Dobson
f6f23ef043 Make TR tests work with contracts enabled.
original commit: edc8bbf6b4601bdf083b1889a11b86bd64488d6d
2014-03-10 21:09:36 -07:00
Asumu Takikawa
951c64f94d Fix TR tests for new error messages
Related to commit fa81fb35f7361f0a985ad4d311400d621a2a5496

original commit: b205c99560d21b80d975dda3fa5f688ae832cd0f
2014-03-10 17:02:31 -04:00
Asumu Takikawa
41291066b4 Update several application type error messages
original commit: fa81fb35f7361f0a985ad4d311400d621a2a5496
2014-03-10 14:59:42 -04:00
Eric Dobson
825fb1c2e4 Changes printer to be more consistent.
Also make printer tests part of the unit tests.

original commit: e34a2484512b94d7f829a013694caf46e360420c
2014-03-06 09:54:06 -08:00
Eric Dobson
f2e2a4b7f9 Add tests for check-below.
original commit: d2c415f5979caf4d93248ee0a9b6a6a2b7ee4736
2014-03-06 09:44:09 -08:00
Asumu Takikawa
64515f386a TR: better error for invalid super-make-object
original commit: 994648c556e026df55d95bddf017b9a5ce723688
2014-03-05 01:45:39 -05:00
Asumu Takikawa
f25af5b48a Improve TR's check for by-name superclass inits
Make sure to check that by-name inits are actually accepted
by the superclass and produce a good error when they aren't.

original commit: b0ba3272cb7dadba24b0bcba73128bef3f312d06
2014-03-05 01:45:39 -05:00
Asumu Takikawa
f27449fc44 TR: fix error case when superclass is not a class
original commit: a0ce1fa02cb8cdd55b6c7bea9d641ca48e3bd6e6
2014-03-05 01:45:39 -05:00
Asumu Takikawa
400b6d438c Rewrite TR pass for class top-level expressions
Instead of making separate passes over the expressions,
make a single pass to collect necessary information for
type-checking.

This enables simpler processing of type annotations,
super initialization arguments, and other things.

original commit: 0bacba7a68321ff08187d0a5d95b02b8351cdd3f
2014-03-05 01:10:44 -05:00
Asumu Takikawa
805cc5e686 Synthesize types for private fields in classes
Allows type annotations to be left out in some cases

original commit: 9c63978a582c2b26be3121cbfd3759de81b7f97f
2014-03-04 16:37:56 -05:00
Asumu Takikawa
5aa1c61c04 One more "undefined identifier" change in TR
For the top-level undefined/missing annotation case

original commit: 2ed669242847587a33f053e717ec2f6a6cf5ba4c
2014-03-04 14:20:16 -05:00
Asumu Takikawa
00c08e48be Change TR's "untyped identifier" error messages
original commit: d62eedaa47b66dc2a804539c3c78b9f313a9243f
2014-03-04 13:51:31 -05:00
Asumu Takikawa
0a77337179 Let TR typecheck more un-annotated definitions
This commit allows definitions without type annotations
to refer to definitions later in a module that do have
type annotations. For example,

  (define (f x) (g 0))
  (: g (-> Integer Integer))
  (define (g x) (add1 x))

Previously, such cases required shuffling type annotations
and/or definitions around to satisfy the type-checker.

Note that typechecking may still depend on ordering when
there are not enough type annotations in the code.

Closes PR 11544

original commit: 343ac526073ab8c2520399316e5391452f3f7dc0
2014-03-04 13:51:31 -05:00
Asumu Takikawa
bc9086e156 Allow flvectors/fxvectors in Any contract
Closes PR 14374

original commit: 5c7046cab32bbe9b54981d13fe5c6ba1ebcd43f0
2014-03-03 13:50:51 -05:00
Asumu Takikawa
9efd61102d Add more tests for PR 14380
Related to 07bde5063b5a3a83f61e85f00a1c6ce6e0a097d2

original commit: d2a3849c6ff39e3c68ce0d1e7fc531352c0086e9
2014-03-01 13:42:34 -05:00
Asumu Takikawa
6ade61f913 One more #:literal-sets
Missed this in 07bde5063b5a3a83f61e85f00a1c6ce6e0a097d2

original commit: 4a078e36d90e2f9ba2a7696c75dd08e47fa52ce2
2014-03-01 13:42:34 -05:00
Eric Dobson
2dd75d1089 Use abbreviations and default values for filters more in unit tests.
original commit: be7c4fb5c0973fa5fa85de8a4fa6c8f723cdc2ed
2014-02-28 19:35:41 -08:00
Eric Dobson
4b876e7221 Add -no-obj and -no-filter abbreviations.
original commit: fe8500437bc854769083feb76bea33f38297694e
2014-02-28 19:34:48 -08:00
Eric Dobson
cf9a3d5008 Rename -no-obj and -no-filter to -empty-obj and -top-filter.
original commit: d401a398cd9317cc0265493e9ed9eb785cd4f5a8
2014-02-28 19:34:47 -08:00
Asumu Takikawa
26746ac8b5 Add #:literal-sets for several TR optimizer cases
The matching was too inclusive in some cases, causing
spurious optimizations (or type-table lookup failures).

Closes PR 14380

original commit: 07bde5063b5a3a83f61e85f00a1c6ce6e0a097d2
2014-02-28 20:57:05 -05:00
Asumu Takikawa
47080bc073 Add make-input-port, make-output-port to TR
original commit: 32cd4d297316b76d9eb7b2e9608618552e8a2a6b
2014-02-28 16:16:01 -05:00
Asumu Takikawa
448e538142 Add install info to TR optimization guide section
original commit: 3effaed55fd1415de5b3b1c30585d8748c805384
2014-02-28 14:30:16 -05:00
Vincent St-Amour
e2b4c39241 More docs about contract costs in TR.
original commit: 1fa0bb0e033e6ed8172045ccb34f1df697636fec
2014-02-28 11:36:51 -05:00
Asumu Takikawa
133a961596 Fix a TR bug for row polymorphic application
The domains in a row polymorphic function weren't checked
properly when row inference was used.

original commit: 32f09c35705206a281fcd1f02b968c7ad02ece69
2014-02-27 18:41:05 -05:00
Matthew Flatt
3bda5906bf LGPL by reference
original commit: 981701d2378179d4ada54b7fd2608df3b89748fd
2014-02-27 15:56:11 -07:00
Asumu Takikawa
f579129af8 Adjust handling of types for non-expressions
Some forms like `define` do not produce a value
and thus do not have a type. Instead of returning
the #<void> value for these cases, return the symbol
'no-type.

Also fix printing in several places to reflect this.

Fixes a regression due to commit 00470e3 and also
fixes an unreported bug with (:print-type ...) on
non-expressions.

Closes PR 13758

original commit: 1747b700976a664ec7ee5a9004e02a173910a2e2
2014-02-27 17:17:54 -05:00
Eric Dobson
7cd4da639f Fix type of - to not be wrong on negative fixnums
Rolling this forward because the math library is no longer dependent on
the broken behavior. Also nothing in the main repo seems to depend on
this.

original commit: 0a81627eca8233edca95368938c739a9d268407f
2014-02-26 22:06:53 -08:00
Asumu Takikawa
a97fe80bbd Catch syntax lifting at the top-level in TR
This is helpful for typechecking forms that lift
expressions such as object instantiation or contracted
values when they are used at the top-level.

It's not normally an issue for typechecking modules
because lifting is delimited by the module extent so that
normal local-expansion will cover it.

original commit: 00470e3e1a09f88a32c6b20682b577669655a2c4
2014-02-26 23:10:26 -05:00
Asumu Takikawa
08fa6df119 Make row inference slightly smarter
Now it works as long as one of the arguments is, in
all cases, a row polymorphic class type

original commit: 30c49028cb124bf252d518b60bb4db94a48943c4
2014-02-26 17:39:13 -05:00