From 1a916e17f889950a82cbf1402a78c210140ffe56 Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Tue, 11 Feb 2014 01:28:31 -0500 Subject: [PATCH] Add in-flvector, in-fxvector to TR base environment original commit: 11bfdce6859a2615a7456a7f30123771eeee528e --- .../typed-racket/base-env/base-special-env.rkt | 5 +++++ .../tests/typed-racket/unit-tests/typecheck-tests.rkt | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/base-special-env.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/base-special-env.rkt index fea04e93..cd0e93a2 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/base-special-env.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/base-special-env.rkt @@ -218,4 +218,9 @@ ;; for `define-runtime-module-path` [(make-template-identifier 'combine-module-path 'racket/runtime-path) (-> -Variable-Reference -Module-Path -Resolved-Module-Path)] + ;; in-fxvector, in-flvector + [(make-template-identifier 'in-fxvector* 'racket/fixnum) + (-> -FxVector (-seq -Fixnum))] + [(make-template-identifier 'in-flvector* 'racket/flonum) + (-> -FlVector (-seq -Flonum))] ) diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt index 3df34270..a69b3c35 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt @@ -1961,7 +1961,7 @@ -Void] [tc-e (place-message-allowed? 'msg) -Boolean] - ;; fxvectors + ;; fxvectors & flvectors [tc-e (let () (define fx1 (fxvector 0 500 34)) (define fx2 (make-fxvector 20 3)) @@ -1970,6 +1970,13 @@ (fxvector-length fx1) (fxvector-copy fx2 0 5)) -FxVector] + [tc-e (let () + (define s1 (in-flvector (flvector 1.0 2.0 3.0))) + (define f1 (sequence-ref s1 0)) + (define s2 (in-fxvector (fxvector 1 2 3))) + (define f2 (sequence-ref s2 2)) + (list f1 f2)) + (-lst* -Flonum -Fixnum)] ;; for/hash, for*/hash - PR 14306 [tc-e (for/hash: : (HashTable Symbol String)