Skip to content

Commit 700506c

Browse files
authored
shallow: stop checking output of base numeric fns (#1316)
add the default "trust fn result" flag to the definitions at the top of base-env-numeric
1 parent e75d9a8 commit 700506c

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88
(only-in "../rep/values-rep.rkt" make-Values)
99
racket/list racket/math racket/flonum racket/extflonum racket/unsafe/ops racket/sequence racket/match
1010
(for-template racket/flonum racket/extflonum racket/fixnum racket/math racket/unsafe/ops racket/base
11+
(only-in typed-racket/base-env/extra-env-lang with-default-T+)
1112
(only-in "../types/numeric-predicates.rkt" index?))
1213
(only-in (combine-in "../types/abbrev.rkt"
1314
"../types/numeric-tower.rkt")
1415
[-Number N] [-Boolean B] [-Symbol Sym] [-Real R] [-PosInt -Pos]))
1516

1617
;; TODO having definitions only at the top is really inconvenient.
1718

19+
(with-default-T+ #true
20+
1821
(define all-int-types
1922
(list -Zero -One -PosByte -Byte -PosIndex -Index
2023
-PosFixnum -NonNegFixnum -NegFixnum -NonPosFixnum -Fixnum
@@ -773,7 +776,7 @@
773776
(unless (free-identifier=? id1 id2 (sub1 phase))
774777
(error 'flonum-operations "The assumption that the safe and unsafe flonum-ops are the same binding has been violated. ~a and ~a are diffferent bindings." id1 id2))])))
775778

776-
)
779+
))
777780

778781
;; numeric predicates
779782
;; There are 25 values that answer true to zero?. They are either reals, or inexact complexes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#lang typed/racket/shallow
2+
3+
(let ((x : Nonnegative-Integer 5))
4+
(= x 0)
5+
(* x 1)
6+
(+ x 1))
7+

typed-racket-test/unit-tests/shallow-rewrite-expansion/main.rkt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@
193193

194194
(define test-registry
195195
(list
196+
(list "base-env-numeric.rkt"
197+
no-shape-check?)
198+
196199
(list "call-with-values.rkt"
197200
(lambda (stx)
198201
(define all-assert* (stx-find-shape-check* stx))

0 commit comments

Comments
 (0)