Commit Graph

105 Commits

Author SHA1 Message Date
Sam Tobin-Hochstadt
f9825cb250 Add test for top-level mutated var fix. 2015-11-18 14:31:48 -05:00
Vincent St-Amour
1e32397658 Refine type for expt.
Fixes rsound.
2015-11-13 10:14:39 -06:00
Sam Tobin-Hochstadt
d9e3c2ac6a Repair da574a4 again. 2015-11-10 08:59:18 -05:00
ben
5d4477d08d safe & efficient (-> Any Boolean) contract
New strategy for compiling the (-> Any Boolean) type to a contract.
When possible, uses `struct-predicate-procedure?` instead of
 wrapping in `(-> any-wrap/c boolean?)`.
Makes exceptions for untyped chaperones/impersonators over struct predicates;
 those are always wrapped with `(-> any-wrap/c boolean?)`.

This change also affects (require/typed ... [#:struct ...]), but not #:opaque
2015-11-09 19:04:02 -05:00
Georges Dupéron
67bd07a84a Fixes type of member and assoc, plus some tests for them. See github bug #223: “(member) has wrong type, exploiting the hole causes segfault”. 2015-11-09 19:04:02 -05:00
Vincent St-Amour
6a2c8ca9f7 Fix the fix to flexpt. 2015-11-09 17:16:09 -06:00
Vincent St-Amour
46f2ed95d3 Fix tests for more conservative types. 2015-11-09 17:16:08 -06:00
Vincent St-Amour
9385f6e350 Yet another fix for expt and complexes.
Found using random testing. Found once.
2015-11-09 17:16:08 -06:00
Vincent St-Amour
5ce00a90d2 Fix sign property of n-ary division.
Found using random testing. Found 4 times.
2015-11-09 17:16:08 -06:00
Vincent St-Amour
23de6a654e Fix another NaN case in expt.
Found using random testing. Found 3 times.
2015-11-09 17:16:08 -06:00
Vincent St-Amour
3ef8fe1739 Fix type of expt for bignums that get converted to infinity.
Found using random testing. Found 10 times.
2015-11-09 17:16:08 -06:00
Vincent St-Amour
a0ef6b1d8c Fix type of expt.
Found using random testing. Found 10 times.
2015-11-09 17:16:08 -06:00
Vincent St-Amour
16a18d7648 Fix type of flexpt.
Found using random testing. Found 9 times.
2015-11-09 17:16:08 -06:00
Vincent St-Amour
e4edf7a9ee Remove tests made obsolete by safety improvements. 2015-11-03 18:04:44 -06:00
Vincent St-Amour
89a06cfae6 Fix bitwise-and on negative numbers.
Found using random testing.
2015-11-03 16:02:05 -06:00
Vincent St-Amour
58e97f83ea Fix sign propagation for division.
Found using random testing.
2015-11-03 15:47:32 -06:00
Vincent St-Amour
da97da5ff8 Fix type of expt when mixing floats and float complexes.
Found using random testing.
2015-11-02 19:31:00 -06:00
Vincent St-Amour
e47ffeb0e8 Fix interaction of sign and underflow in fl/.
Found using random testing.
2015-11-02 19:31:00 -06:00
Asumu Takikawa
9b8b525d42 Make unit test less noisy 2015-10-24 04:13:47 -04:00
Asumu Takikawa
2479dffde0 Fix #:opaque require clauses at the top-level 2015-10-21 17:23:24 -04:00
Asumu Takikawa
b5dc5585be Fix part of GH issue #208
For private `define-values` in classes with multiple variables, don't
eagerly throw type errors in the synthesis step. Instead, wait
until the later checking step when the environment will be correctly
set up.

When the initial synthesis typecheck fails, yield type Any for
the environment. If the typecheck should really fail, this is ok. If
not, then the user can add a type annotation.

A better long-term strategy is to change the handling of environments
so that the type environment gets refined as definitions are checked.
This way all annotations that the user writes are factored into the
initial environment and unannotated variables will have their types
synthesized.
2015-10-20 14:06:32 -04:00
Asumu Takikawa
3149b0a305 Fix send on a receiver with recursive type
Thanks to Matthias for finding the bug
2015-10-19 16:27:11 -04:00
Vincent St-Amour
5ed30d7fcf Fix contract build. 2015-09-11 13:12:49 -05:00
Daniel Feltey
2e0cc095c7 Initial support for typed units in typed racket.
Most unit forms are supported, including most of the "infer" forms that
infer imports/exports/linkages from the current context.

Notably, none of the structural linking forms for units are supported, and
`define-unit-binding` is also currently unsupported.
2015-09-10 16:32:11 -05:00
Alexis King
4bf3479776 Add types for writeln and println 2015-09-08 15:58:07 -04:00
Vincent St-Amour
fd3941c062 Remove dependency on unstable/contract. 2015-09-07 21:38:22 -05:00
Brian Lachance
77334808a8 Allow AnyValues as a return type in user code
Closes PR 14217
2015-09-07 13:26:34 -05:00
Asumu Takikawa
f5f84c7625 Fix for*/fold and for*/lists
Only parse and use the type annotations if they are present on
all fold variables. This matches the default for other forms in TR.
Also, this will usually result in a "insufficient type information"
message which is more helpful than if TR chose some default type.

Closes PR 15138
Closes PR 14893
2015-08-25 11:44:24 -04:00
Asumu Takikawa
94ce4b203e Use tc-expr for top-interaction functions instead
This restricts operations like `:print-type` to only
work on expressions. This seems like a reasonable
restriction and simplifies the implementation.
2015-08-14 21:25:54 -04:00
Asumu Takikawa
509f1aa20c Update type for copy-directory/files 2015-08-14 01:02:54 -04:00
Vincent St-Amour
f6779f2cfa unstable/macro-testing -> syntax/macro-testing 2015-08-05 13:13:50 -05:00
Brian Lachance
5e0e8ed713 Fix missing match cases when trying to bind AnyValues typed "results"
tc-toplevel has fixes for define's, tc-let-unit has fixes for let's
2015-07-29 11:44:29 -04:00
Asumu Takikawa
91279f46c7 Add types for recent functions moved from unstable 2015-07-28 14:49:26 -04:00
Asumu Takikawa
2819a62b30 Add types for new syntax operations 2015-07-27 17:15:54 -04:00
Vincent St-Amour
f35b5a9182 check-duplicate -> check-duplicates 2015-07-20 16:17:39 -05:00
Vincent St-Amour
72fb041211 Replace uses of unstable/function and /list with the equivalent core libs. 2015-07-20 16:17:39 -05:00
Matthew Flatt
1842aaa2bd fixes for some tests
The `identifier-binding` function is now senstive to the "macro
introduction" scope that's on an indentifier provided to a currently
expanding macro. Unit tests for TR need to use
`syntax-local-intorduce` to remove it, in the same way that `tc-setup`
already does.

Also, recognize a class expansion when it's wrapped with
`#%expression`, since `class` now expands that way sometimes.
2015-07-16 08:40:35 -06:00
AlexKnauth
aec5fad4be make append preserve non-emptyness of first argument
see https://github.com/racket/scribble/pull/8#discussion_r33423152
2015-06-28 12:07:42 -04:00
Vincent St-Amour
6bef6e6ca8 Make type of abs and magnitude more precise.
Fixes a failing test.
2015-06-16 12:00:07 -05:00
Eric Dobson
0498f548c1 Fix the type of abs on negative zeros. 2015-06-16 10:43:01 -05:00
Asumu Takikawa
bc3443b393 Change Module-Path type to accommodate submodules
Closes #84
2015-06-10 12:21:51 -04:00
Asumu Takikawa
b63514a2c3 Allow more flexible keywords in ->* types
Keyword argument types in ->* are now allowed intermixed with
positional arguments instead of at the end.

Closes #145
2015-06-02 01:05:05 -04:00
Eric Dobson
8014db0f7d Make infer unfold Mu before spliting on Unions. 2015-05-19 20:44:15 -07:00
AlexKnauth
e075523e5e change type of partition 2015-05-19 16:29:49 -04:00
Mira Leung
3a70ed5669 Update to fl>= tests 2015-05-14 12:13:14 -04:00
Mira Leung
9b88243b5c Unit tests for fl comparison operators 2015-05-14 12:13:14 -04:00
Mira Leung
df0f9d53bd Unit tests for fl>= typechecking 2015-05-14 12:13:14 -04:00
Eric Dobson
1e890f18be Add support for running raco test on TR unit tests. 2015-05-14 12:13:14 -04:00
Marc Burns
609d6189e9 Improve typecheck for private field initializers
This patch addresses two issues with `typed/racket/class`:

1. For multiple private fields declared with `define-values`, type
information does not propagate from the values produced by the
initialization expression to the declared fields. This breaks soundness
of private fields: A field can be annotated with a type that does not
contain the field's initial value.

This was resolved by keeping a table of temporary bindings introduced in
the expansion of the initializer along with their types. The field
setter's type is then checked against that of the corresponding
temporary.

2. The class body typechecker assumes that the `expr` of
a `define-values` clause will expand to a bare `(values vs ...)`.

This was resolved by generalizing the template for matching an expanded
`define-values` initializer and extracting the type information from the
`expr` instead of each element in `(vs ...)`.
2015-05-12 18:42:05 -04:00
Eric Dobson
90061c2b96 Add filters for trivial cases in arithemetic procedures. 2015-05-02 08:26:50 -07:00