Commit Graph

3486 Commits

Author SHA1 Message Date
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
Eric Dobson
5cbc1369d4 Revert "Fix type of - to not be wrong on negative fixnums."
The math library is relying on the current broken behavior. Revert until
we can fix it.

original commit: 62a09958d2d8eca8d44ade23e83a9ecdc4777ecc
2014-02-26 00:34:40 -08:00
Eric Dobson
b227a5e50c Fix type of - to not be wrong on negative fixnums.
original commit: faab297ab9a74d167a23e84756737208bd5c8b02
2014-02-25 09:54:28 -08:00
Eric Dobson
e3bb9c3e0e Add missed optimization tests for add1/sub1.
original commit: 40e3c50db7d5873592bc109dc0a0771e473d2107
2014-02-25 00:30:52 -08:00
Eric Dobson
37f274004a Revert split of float-ops because the remaining ones never trigger.
flreal-part only is valid on float-complex numbers and the code in
float-complex.rkt already covers it.

original commit: 5f636af86ad3cb7a4bb462c90c099ba3b662438f
2014-02-24 22:40:36 -08:00
Asumu Takikawa
9ba5f398cf Add TR rep-tests to the main unit tests file
Forgot to make this change in commit
7907320733b6d29b2382e016c10888acbf4e1c67

original commit: ac6ec3b43b9e2c838235f48a08ce8c15586294d3
2014-02-25 01:34:43 -05:00
Asumu Takikawa
36fbea7669 Remove some debugging code in subtype checker
original commit: 2d46d430b79d92af3d5c00b001860c1844f96892
2014-02-25 01:22:42 -05:00
Asumu Takikawa
2665e2b916 Use the correct index for unsafe-Type-key
The unsafe operation didn't return the same result as
the safe operation, meaning any checks related to type keys
were giving the wrong result. As a result, some subtyping
clauses were not triggered.

original commit: 7907320733b6d29b2382e016c10888acbf4e1c67
2014-02-25 01:22:42 -05:00
Asumu Takikawa
2dd8725cbd Fix infinite loop in List: expander in subtyping
The match expander calls `resolve` during subtyping, which
is a problem for types that recur through the environment like
Struct types because it doesn't coordinate with the cache
for subtyping.

Closes PR 14364

original commit: 7585581f00a40f59d5f29159622a10640cfbdec9
2014-02-24 18:07:02 -05:00
Asumu Takikawa
c26f9b4c73 Support ValuesDots in a typechecking a funapp
Closes PR 13651

original commit: 4f3c98f7549bc0fe2641dea92bd1188bb527bfdf
2014-02-24 10:54:31 -05:00
Eric Dobson
a8e01d8707 Add more optimizations for projections.
original commit: 262fad814afc33dbac8e927409dca225faf00686
2014-02-23 23:45:28 -08:00
Eric Dobson
758a055b0b Change float optimizations to not warn on projections.
original commit: b89a56e0ec4e561ae70b823be3140b860be3d34c
2014-02-23 23:45:27 -08:00
Eric Dobson
8b6c27cf1d Refine type for angle
original commit: 4ca07b3ac8cf1a9839de8330c2324fff4b0344fc
2014-02-23 23:45:26 -08:00
Eric Dobson
db4175182f Add delays to unboxed let to avoid optimizing twice.
original commit: c1bfc9601e5fabd995099cc8b36c56f72c02a1d3
2014-02-22 11:55:19 -08:00
Eric Dobson
22daa0383f Make TR optimizer tests reset the port line counting.
This means new logging lines should not change the numbering of all existing
logs making diffs much cleaner.

original commit: f1b52be26ad8635bfa1d6bfe49e8e36780577a92
2014-02-22 11:51:46 -08:00
Asumu Takikawa
4d9431279e Fix DrRacket's insert-large-letters
This is a temporary fix in the sense that the typed/mred
wrapper that this relies on is incomplete. Once the typed
racket/gui bindings are merged, a more complete
insert-large-letters will be checked in.

Closes PR 14362

original commit: 2295f71dbeb21b8ba3231d25cafb070d0be585dc
2014-02-21 14:39:46 -05:00
Asumu Takikawa
c4bfa96216 Fix static contract generation for method case->s
original commit: 6710d08ff1dfe3283831773912f5f0a77dc01289
2014-02-21 14:38:45 -05:00
Asumu Takikawa
f0cff55467 Add more class/object functions to TR base-env
original commit: 19b785956f5e901c8177d8576f28013ce103c0bc
2014-02-21 14:11:14 -05:00
Asumu Takikawa
930c1f6c6b Make typed case-lambda methods work
original commit: 30cd701cf0875cf16d5e114d97e5004ca243681e
2014-02-21 14:09:50 -05:00
Asumu Takikawa
86cb262c3c Move typed class unit tests into a separate file
Export some helpers from typecheck-tests in a submodule

original commit: 5a3e0a76daedf7c2a457ba9c05a205c9c607e2e0
2014-02-21 13:59:34 -05:00
Asumu Takikawa
fc39560dc3 Support set-field! in Typed Racket
original commit: c623e662e0a95d992dd46d2b1ad8889566706952
2014-02-21 12:32:59 -05:00
Asumu Takikawa
492dea8408 Adjust type variable syntax for typed classes
This makes it consistent with other forms like the
new `lambda` form.

original commit: 8ce376f50368c4ac0266d02e3b0efb3f7e30f1df
2014-02-21 11:47:08 -05:00
Asumu Takikawa
3aff8d94e9 Fix type for first argument of dynamic-place
Closes PR 14363

original commit: 315034bbe54252ceed4400308072c09c52457d5f
2014-02-20 23:17:17 -05:00
Asumu Takikawa
8d97a5cbdd Temporarily disable TR class unit test
This unit test is broken due to an issue with using
the : form for external names in classes. Since : checks
if the id is bound, it doesn't work if there is an internal
name different from the external name (since only the
internal one is in scope in the class body).

Haven't decided whether to put annotations on internal
identifiers instead or to not run the check for class
member names.

original commit: fe811e33aaf50fe68ad2ff14a7c46685a03e1f19
2014-02-20 23:14:23 -05:00
Asumu Takikawa
a7fd2a8f11 Expand on docs for TR class init/init-rest args
original commit: 8c83e1a08deac604fe4685a915cd010ad0a06db4
2014-02-20 18:00:44 -05:00
Asumu Takikawa
41cee0f69a Reorganize docs on typed classes
Use subsections and put the special forms first

original commit: f856bce277988ae708a864e20a908247c14ec8e3
2014-02-20 17:33:45 -05:00
Asumu Takikawa
ffdb6752f3 Revise TR classes & docs based on feedback
original commit: 1c6c0855f788fb311db7a93b5e81bbcd6b24d03b
2014-02-20 16:50:28 -05:00
Asumu Takikawa
6cd8927abc Move internal unit tests out into a separate file
original commit: e7e354f69ae4846b3d37cce58268a01d9ee6cca7
2014-02-20 16:50:28 -05:00
Asumu Takikawa
f2260843b0 Add support for positional init arguments for TR
This includes support for positional inits and also
init-rest along with make-object and instantiate.

original commit: 18182d16a615f5ecf7bed5428374010f609bb59e
2014-02-20 16:50:27 -05:00
Asumu Takikawa
7df37ff6a8 Use shorthand notation for classes in subtype tests
original commit: 0b1eec20b5a1ffb569c0e4332bb459ce47c864b9
2014-02-20 16:50:27 -05:00
Asumu Takikawa
aa15b72985 Fix integration test for new class type syntax
original commit: cd2ef502b013292b948e1ba7932f2d6b97871d76
2014-02-20 16:50:27 -05:00
Asumu Takikawa
07243dd154 Add static contract tests for classes
original commit: 39b237043d0d91058ac8cb041eb665f502b17590
2014-02-20 16:50:27 -05:00
Asumu Takikawa
10f04eb58e Convert parse tests w/ classes to use abbreviations
original commit: dff2fa6de78917848c121cc60264176fe2e7b851
2014-02-20 16:50:27 -05:00
Asumu Takikawa
3786645026 Disallow non-aliases in #:implements
original commit: 92d5e4a8aecbb9b121652f1e38c9bee76db64e0f
2014-02-20 16:50:27 -05:00