Skip to content

Commit 7479bef

Browse files
committed
enable contracts when running the github job for integrated tests
1 parent 21f636e commit 7479bef

File tree

2 files changed

+29
-28
lines changed

2 files changed

+29
-28
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ jobs:
3939
env:
4040
PLT_TR_CONTRACTS: 1
4141
- run: racket -l typed-racket-test -- --unit
42+
- run: raco setup math
43+
if: ${{ matrix.enable-contracts }}
4244
- run: racket -l typed-racket-test -- --int --excl gui-lang
43-
if: ${{ !matrix.enable-contracts }}
4445
- run: xvfb-run racket -l typed-racket-test -- --just typed-racket-test/succeed/gui-lang.rkt
4546
if: ${{ !matrix.enable-contracts }}
4647
- run: racket -l typed-racket-test -- --opt

typed-racket-lib/typed-racket/typecheck/tc-expr-unit.rkt

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -295,34 +295,34 @@
295295
[_ (tc-expr/check form #f)])]
296296
;; opt function def
297297
[(~and (let-values ([(f) fun]) . body) opt:opt-lambda^)
298-
#:when expected
299-
(define conv-type
300-
(match expected
301-
[(tc-result1: fun-type)
302-
(match-define (list required-pos optional-pos optional-supplied?)
303-
(attribute opt.value))
304-
(opt-convert fun-type required-pos optional-pos optional-supplied?)]
305-
[_ #f]))
306-
(if conv-type
307-
(begin (tc-expr/check/type #'fun conv-type) (fix-results expected))
308-
(tc-expr/check form #f))]
298+
#:when expected
299+
(define conv-type
300+
(match expected
301+
[(tc-result1: fun-type)
302+
(match-define (list required-pos optional-pos optional-supplied?)
303+
(attribute opt.value))
304+
(opt-convert fun-type required-pos optional-pos optional-supplied?)]
305+
[_ #f]))
306+
(if conv-type
307+
(begin (tc-expr/check/type #'fun conv-type) (fix-results expected))
308+
(tc-expr/check form #f))]
309309
[(~and _:kw-lambda^
310-
(let-values ([(f) fun])
311-
(let-values _
312-
(#%plain-app
313-
maker
314-
lambda-for-kws
315-
(case-lambda ; wrapper function
316-
(formals . cl-body) ...)
317-
(~or (quote (mand-kw:keyword ...))
318-
(~and _ (~bind [(mand-kw 1) '()])))
319-
(quote (all-kw:keyword ...))
320-
. rst))))
321-
(define p (plambda-property form))
322-
(ret (kw-unconvert (tc-expr/t (plambda-property #'fun p))
323-
(syntax->list #'(formals ...))
324-
(syntax->datum #'(mand-kw ...))
325-
(syntax->datum #'(all-kw ...))))]
310+
(let-values ([(f) fun])
311+
(let-values _
312+
(#%plain-app
313+
maker
314+
lambda-for-kws
315+
(case-lambda ; wrapper function
316+
(formals . cl-body) ...)
317+
(~or (quote (mand-kw:keyword ...))
318+
(~and _ (~bind [(mand-kw 1) '()])))
319+
(quote (all-kw:keyword ...))
320+
. rst))))
321+
(define p (plambda-property form))
322+
(ret (kw-unconvert (tc-expr/t (plambda-property #'fun p))
323+
(syntax->list #'(formals ...))
324+
(syntax->datum #'(mand-kw ...))
325+
(syntax->datum #'(all-kw ...))))]
326326
[(~and opt:opt-lambda^
327327
(let-values ([(f) fun])
328328
(case-lambda (formals . cl-body) ...)))

0 commit comments

Comments
 (0)