Commit Graph

159 Commits

Author SHA1 Message Date
Eric Dobson
e5ea1f4bb6 Make zero? sound with regards to NaN. 2015-03-28 14:08:20 -07:00
Sam Tobin-Hochstadt
718bc82b5d Avoid providing def-redirect. 2015-03-26 12:23:48 -04:00
Alexis King
b54d8dc04a Strengthen the types for member, memv, memq, and memf
Fixes #61.
2015-03-25 16:44:42 -07:00
Vincent St-Amour
b3bdb40ab7 Optimize pair operations, even in the absence of syntactic pair types. 2015-03-24 16:47:06 -04:00
Alexis King
2a4ce892ae Merge branch 'integral-to-inexact' 2015-03-20 19:43:04 -07:00
Alexis King
aab2d9efcf Include more specific types for integers converted to floats 2015-03-19 18:54:11 -07:00
Sam Tobin-Hochstadt
ee7bed777b Add dependency on 6.2.0.2.
This is definitely needed for the new `begin-encourage-inline`
submodule, but also needed for various other changes (such as
`dynamic-object/c`).
2015-03-19 21:45:15 -04:00
Sam Tobin-Hochstadt
0dce19e4bf Reduce more dependencies.
Use `syntax/parse/pre` (checked with @rmculpepper).
Use new `begin-encourage-inline` submodule.
Remove use of `match` in TR runtime-loaded code.
2015-03-19 21:41:58 -04:00
Sam Tobin-Hochstadt
4709536653 Split prims.rkt to reduce dependencies.
There are several new files: one for structure prims, one for
annotation-related prims, one for contract related ones. The prims-contract
file uses trickery with submodules to avoid a direct dependency
on `racket/contract`.

Additionally, the rewritten versions of `for/set` et al now use
a submodule to avoid a direct dependency on `racket/set`.
2015-03-18 18:47:49 -04:00
Sam Tobin-Hochstadt
333a8b9bd7 Remove long lines, and inline vector-copy to remove dependency. 2015-03-18 18:23:56 -04:00
Asumu Takikawa
7a09bac1e3 Handle more cases for opt-arg function contracts
Allow more cases that are allowed for ordinary function
contracts and explicitly error instead of internal errors
for other cases.

Closes Github Issue #50
2015-03-17 15:52:21 -04:00
TwoPoint7182818
911036c2a6 Make order-of-magnitude more specific
(order-of-magnitude n) is only negative if n < 1. Hence it is non-negative for all positive integers.
2015-03-15 20:48:46 -04:00
Asumu Takikawa
8106d318f1 Fix first-order check for TR's opaque object/c
Closes PR 15003
2015-03-13 16:52:34 -04:00
Asumu Takikawa
197cdeac9b Fix contract, remove comment signature 2015-03-12 01:35:54 -04:00
Asumu Takikawa
d19bed0e8b Fix inaccurate data definition comment 2015-03-10 15:18:03 -04:00
Asumu Takikawa
8e6710438f Support prefabs for unsafe-struct-ref 2015-03-10 15:18:02 -04:00
Asumu Takikawa
5d708ab53f Add typechecking for prefab structs
Adds a new Prefab type constructor along with support for
the use of `struct` with the #:prefab keyword.
2015-03-10 15:14:51 -04:00
Asumu Takikawa
50f2271917 Fix minor contract violation in REPL messages 2015-03-09 15:59:02 -04:00
Asumu Takikawa
c00cc17e07 Add cond-contracts to name-env functions
This helped for debugging, especially since some of
the comments were inaccurate. Removed contract comments
that aren't more specific than the code contracts.
2015-03-09 15:59:02 -04:00
Asumu Takikawa
fb0c96e7f0 Forgot to add this change to the previous commit
(put requires in the right phase)
2015-03-09 15:57:22 -04:00
Asumu Takikawa
96e741dc1b Add srcloc instead of a quoted syntax for casts 2015-03-06 16:09:31 -05:00
Sam Tobin-Hochstadt
a3e25231a6 Look up unrenamed versions of type aliases as well.
Fixes bug reported by Alexander Knauth.
2015-03-06 12:13:40 -05:00
Sam Tobin-Hochstadt
7a67243d68 Fix contract provide fixup to handle contracts at the beginning. 2015-03-06 09:41:29 -05:00
Matthew Flatt
011649a654 move contract submodules to start of enclosing module
Putting the contract submodules early enough allows them to be used
for `module*` submodules.

Repairs a problem reported by Alexander:
 http://lists.racket-lang.org/users/archive/2015-March/066164.html
2015-03-06 09:41:29 -05:00
Alexis King
c79b61a751 Adjust named-let to use the return type annotation whenever possible
Fixes #43
2015-03-04 15:17:35 -08:00
Asumu Takikawa
33543ce054 Use absent in some row poly class contracts
When exporting row polymorphic functions from TR, just
use absent clauses to ensure that TR won't accidentally
try to add pre-existing fields/methods. No sealing is
needed because the typechecker enforces parameteric use
of the class.
2015-03-04 16:26:35 -05:00
Asumu Takikawa
8d0c352dcc Add a custom object contract for use in TR
This corresponds to the more strict object contracts
from the OOPSLA paper. Also use `object/c-opaque` in
TR contract generation
2015-03-04 16:26:35 -05:00
Asumu Takikawa
e2fd3b6653 Enable opaque class contracts in TR 2015-03-04 13:28:06 -05:00
Asumu Takikawa
e80f17cbad Adjust contract generation for some Instance types 2015-03-04 13:27:31 -05:00
Andrew Kent
ea942c2110 fixed base/value overlap bug 2015-03-03 23:20:15 -05:00
Alexis King
3f67cfea7c Use contract-neg-party to accurately handle contracted applications
Fixes #38
2015-03-03 16:15:09 -08:00
Andrew Kent
766bd83a98 removed subtle latent bug in tc-let-unit
there was a values mismatch bug hiding in here that hadn't ever (to my knowledge) been triggered -- perhaps this code is dead?
2015-03-01 12:27:51 -05:00
Asumu Takikawa
165a2afa5b Fix augment/inner contract generation 2015-02-28 14:02:57 -05:00
Matthew Flatt
4116acc2d0 define-runtime-module-path-index for reference to a contract submodule
Cooperate with `raco exe`.
2015-02-27 13:39:46 -07:00
Asumu Takikawa
ec15f58542 Basic support for contract gen for PolyRow types
Currently only supports the typed export side. The other
way needs contract features that haven't been merged yet.
2015-02-27 15:19:30 -05:00
Asumu Takikawa
6a855f664c Reorganize type->contract for polymorphic methods 2015-02-27 13:37:07 -05:00
Asumu Takikawa
d0a8b8c25b Fix prims for quote-syntax -> quote change 2015-02-27 00:17:02 -05:00
Andrew Kent
5d84201789 fixed proposition parsing 2015-02-26 13:46:42 -05:00
Matthew Flatt
4622a4cc32 use quote instead of quote-syntax for annotations in macro expansion
The choice of identifier is arbitrary, but avoiding `quote-syntax`
may be more forward-comptiable as the macro system changes.
2015-02-25 21:15:23 -07:00
Matthew Flatt
1469306a8e use free-id=? instead of bound-id=? for letrec analysis
With the current macro expander, either should work, but
`free-id=?` is arguably the right choice for determining
that two identifiers refer to the same binding.
2015-02-25 21:15:18 -07:00
Asumu Takikawa
78fc0f19e7 Improve types for private field accessors
Enables better occurrence typing for private fields
2015-02-23 15:38:28 -05:00
Asumu Takikawa
5b237018ef Add a #:var argument to ->acc
Allows a name reference for Path objects to be specified
for ->acc function types.
2015-02-23 15:38:28 -05:00
Asumu Takikawa
fed9ac40eb Adjust the recursive type alias registration pass
Instead of registering aliases before we find out if they are
recursive or not, register them after that information is found.
That avoids spurious aliases that end up in the type name
environment without the need for a `remove-type-name` operation.
2015-02-23 15:38:28 -05:00
Alexis King
425c584a30 Handles expansion of internal forms inside splicing-syntax-parameterize
Fixes PR 14973

Closes #24.
2015-02-21 15:40:23 -05:00
Asumu Takikawa
39446d64d5 Fix internal error format string in init-envs 2015-02-17 18:29:12 -05:00
Asumu Takikawa
5180e601db Adjust the fix in 619d6945c3
For unions of multiple type aliases the new placeholder
would cause union collapsing incorrectly. Put an uninterned
symbol in the placeholder types to avoid this.
2015-02-17 14:00:07 -05:00
Alexis King
619d6945c3 Prevent type alias placeholders from collapsing in unions with symbols
Fixes #26
2015-02-16 13:22:35 -05:00
Asumu Takikawa
d0a7c911df Improve plambda-handling in check-class-unit
Simplify the property copying code for method processing.
2015-02-16 02:42:57 -05:00
Asumu Takikawa
d77044f902 Minor refactoring to use #:when in a match clause 2015-02-13 00:12:14 -05:00
Asumu Takikawa
52cc284d87 Better error msg for structs with the same name
Thanks to Max for the suggestion
2015-02-13 00:10:19 -05:00
Asumu Takikawa
83dc3884aa Fix accessor type for with-tr-contracts test 2015-02-12 23:44:19 -05:00
Asumu Takikawa
31d6c04608 Use Univ instead of (make-Univ) 2015-02-12 16:31:18 -05:00
Asumu Takikawa
62c86d5ddd Added occurrence typing for private fields.
This also tracks mutation of private fields to ensure that only
non-mutated field types are allowed to be refined.
2015-02-12 16:31:18 -05:00
Asumu Takikawa
177d1a7f68 Adjust type of dynamic-require (returns 1 value)
The implementation (and now docs) of dynamic-require
specifies that it can only return a single value, even
when the required binding is syntax.
2015-02-12 14:25:44 -05:00
Asumu Takikawa
7ae1247539 Add missing types for Ref. 18.2.3 functions 2015-02-11 14:27:52 -05:00
Asumu Takikawa
917ecaae9b Fix type for current-library-collection-paths
Closes PR 14975
2015-02-11 14:27:40 -05:00
Sam Tobin-Hochstadt
13614ae5c2 Always use rename-out in generated provides.
Since rename-transformers can generate free-id=? names, we could
end up providing two things with the same name.

Fixes PR 14972.
2015-02-09 16:40:39 -05:00
Sam Tobin-Hochstadt
bafc7d93e7 Raise proper errors when there are too many contract constraints.
Fixes PR 14890.

This could potentially be relaxed if needed, but this addresses
the immediate issue.
2015-02-09 16:37:32 -05:00
Sam Tobin-Hochstadt
ae0717d970 Move generated contracted provides to a submodule.
This allows the main TR module not to explicitly
depend on the contract library. Each exported name
can be redirected to either the original name (for a
typed client) or to another macro (for an untyped
client) which expands to a `local-require` for the
relevant submodule (named `#%contract-defs`).

Thanks to Matthew for the initial idea and an
implementation in plai-typed that this is based on.
2015-02-08 20:37:04 -05:00
Asumu Takikawa
6c09d52b2e Generalize method handling in TR
Previously, TR only recognized a subset of the syntax that
the class macro accepts for method definitions (and errored
unhelpfully on other cases). Though that subset was sufficient
for most methods, macros will sometimes produce unusual forms.
2015-02-08 18:29:37 -05:00
Vincent St-Amour
787df49140 Make type of division more lenient.
Thanks to John Clements for the report.
2015-02-04 14:06:54 -05:00
Asumu Takikawa
8402ee1635 Add FSemaphores to Typed Racket 2015-02-02 11:23:09 -05:00
Asumu Takikawa
e85cc55f6f Add types for call-with-semaphore 2015-02-02 02:54:01 -05:00
Alexis King
032a11fdae Add support for use-dir? param of in-directory
Closes #21.
2015-01-31 09:34:01 -05:00
Alexis King
7122d93de8 Make Path a subtype of Module-Path
Closes #20.
2015-01-31 09:33:50 -05:00
Alexis King
9bad7f0128 Improve the type for directory-list 2015-01-29 09:55:06 -05:00
Asumu Takikawa
1cbdad12f6 Remove uses of srfi/1 in Typed Racket 2015-01-28 13:31:56 -05:00
Vincent St-Amour
ef35d21a31 Refine type of current-inexact-milliseconds.
Thanks to Alex Knauth for the report.
2015-01-27 20:30:28 -05:00
Alex Knauth
d93b387150 more useful types for hasheqv and hasheq too
Closes #16.
2015-01-24 12:37:12 -05:00
Alex Knauth
19455584ab more useful type for hash
still only up to 8 arguments
2015-01-24 12:36:16 -05:00
Asumu Takikawa
066e4356b4 Support type alias definitions in class bodies 2015-01-22 14:22:11 -05:00
Asumu Takikawa
a45fd96224 Remove unneeded unit imports in check-class-unit 2015-01-21 16:19:20 -05:00
Asumu Takikawa
5c090ba686 Fix new error messages for class/object types
Closes PR 14942
2015-01-21 13:55:19 -05:00
Asumu Takikawa
8e63b14f4c Fix contract for contracted TR tests 2015-01-21 13:55:11 -05:00
Asumu Takikawa
4ab7ba2578 Improve check-below errors for classes/objects
Also fix a type-checker bug that the tests for the
error messages uncovered.
2015-01-20 19:58:25 -05:00
Alexis King
b9e600dc1a Add contract generation support for Async-Channelof 2015-01-19 21:11:09 -05:00
Asumu Takikawa
455bc7664b Fix type dictionary entries for overriden methods
Add typed Racket Esquire as a test case
2015-01-19 16:12:31 -05:00
Asumu Takikawa
874f426e9c Remove unnecessary requires in extra-env-lang.
Avoids phase 0 dependencies on TR internals.
2015-01-19 13:41:29 -05:00
Sam Tobin-Hochstadt
5ba9633e78 Improve hash-table overlap.
Thanks to Alex Knauth for the code and Jordan Johnson for the test case.
2015-01-19 09:48:50 -05:00
Asumu Takikawa
769cd04b37 Add cond-contract requires to fix contracted tests 2015-01-18 14:20:50 -05:00
David Van Horn
88afb40f60 Parens 2015-01-17 12:54:31 -05:00
Andrew Kent
7633d6d1b8 let/ec swapped out in update 2015-01-17 14:20:30 +05:30
Sam Tobin-Hochstadt
9a39c3e793 Add for/set and for*/set to Typed Racket. 2015-01-16 09:43:37 -05:00
Andrew Kent
e7d61bd982 fixed struct field updates 2015-01-14 15:32:34 +05:30
Asumu Takikawa
e922807837 Fix contract for tc/send 2015-01-14 00:23:28 -05:00
Asumu Takikawa
2c0d4b8aec Undo local-require change from 7afeada73d
Recent changes to contract generation have made this
`local-require` unnecessary. Using `require` is preferable
since `local-require` can interact poorly with submodules.
2015-01-14 00:23:27 -05:00
Andrew Kent
8c5c032520 Merge pull request #10 from andmkent/master
path-type now allows normal internal errors
2015-01-14 06:09:25 +05:30
Asumu Takikawa
ded837ce10 Fix tc/send to accept keyword argument methods
Closes PR 14910
2015-01-12 18:36:35 -05:00
Andrew Kent
fd4f05e64b path-type sep file 2015-01-10 15:11:10 -05:00
Andrew Kent
f3104f383e path-type allow non-subtype struct acc
proper path-type mismatch error
2015-01-10 15:10:05 -05:00
Asumu Takikawa
9bf90a7734 Add more type abbreviations 2015-01-09 13:36:36 -05:00
Asumu Takikawa
de926372fa Loosen contracts for with-tr-contracts unit test 2015-01-09 11:19:57 -05:00
Andrew Kent
3ed6b464e7 overlap tests for Seq and Evt, minor overlap fix 2015-01-06 15:01:16 -05:00
Andrew Kent
16db5ecc78 dont let-alias type vars, better overlap & restrict 2015-01-06 13:51:40 -05:00
Andrew Kent
dc2ce38aef Merge pull request #5 from andmkent/master
fixed mutation let-aliasing bug
2015-01-05 09:15:57 -05:00
Asumu Takikawa
8a663a5499 Remove unnecessary function argument 2015-01-04 20:33:46 -05:00
Asumu Takikawa
dbaebdd305 Propagate expected types better for private fields
Closes PR 14911
2015-01-04 19:39:14 -05:00
Andrew Kent
9d41048747 fixed mutation let-aliasing bug
let-aliasing initially forgot to check if a variable that might act as
an alias was ever mutated. fixed by disallowing a mutated variable to
act as an alias.
2015-01-03 23:03:45 -05:00
Vincent St-Amour
a943d85375 Preserve more source locations for function definitions. 2015-01-02 20:57:08 -05:00
Asumu Takikawa
791a16e54f Fix method definitions with lambda/case-lambda
Closes PR 14904
2015-01-01 01:59:37 -05:00