Tried to make low/typed-untyped-module.rkt tests for require/provide run. In the end the error was just due to https://github.com/racket/typed-racket/issues/228, upgrading to a newer build of Racket fixed this. Added a couple of typed/untyped utilities in the process.
This commit is contained in:
parent
29affb88c8
commit
fbc2411603
|
@ -1,4 +1,4 @@
|
|||
#lang typed/racket
|
||||
#lang typed/racket/no-check
|
||||
|
||||
|
||||
#;(λ ([x : (U (Vector Number) (Vector String String))])
|
||||
|
|
|
@ -11,10 +11,10 @@
|
|||
(require (for-syntax racket/base))
|
||||
|
||||
(include/reader "low.rkt" (λ (source-name in)
|
||||
(port-count-lines! in)
|
||||
(do ()
|
||||
[(let-values ([(line column position)
|
||||
(port-next-location in)])
|
||||
(> line 1))]
|
||||
(read-line in))
|
||||
(read-syntax source-name in)))
|
||||
(port-count-lines! in)
|
||||
(do ()
|
||||
[(let-values ([(line column position)
|
||||
(port-next-location in)])
|
||||
(> line 1))]
|
||||
(read-line in))
|
||||
(read-syntax source-name in)))
|
|
@ -6,6 +6,47 @@
|
|||
|
||||
;; ==== low/typed-untyped-module.rkt ====
|
||||
|
||||
(require typed/untyped-utils)
|
||||
(provide half-typed-module typed/untyped-prefix define-modules)
|
||||
|
||||
;; half-typed-module
|
||||
(define-syntax-rule (typed-module m typed-language untyped-language . body)
|
||||
(module m typed-language . body))
|
||||
|
||||
(define-syntax-rule (untyped-module m typed-language untyped-language . body)
|
||||
(module m untyped-language . body))
|
||||
|
||||
(define-typed/untyped-identifier half-typed-module typed-module untyped-module)
|
||||
|
||||
#| ;; test: should work in no-check but not in typed:
|
||||
(half-typed-module moo typed/racket typed/racket/no-check
|
||||
(: foo One)
|
||||
(define foo 2))
|
||||
|#
|
||||
|
||||
;; typed/untyped-prefix
|
||||
(define-syntax-rule
|
||||
(typed-typed/untyped-prefix [typed-prefix ...] [untyped-prefix ...] . rest)
|
||||
(typed-prefix ... . rest))
|
||||
|
||||
(define-syntax-rule
|
||||
(untyped-typed/untyped-prefix [typed-prefix ...] [untyped-prefix ...] . rest)
|
||||
(untyped-prefix ... . rest))
|
||||
|
||||
(define-typed/untyped-identifier typed/untyped-prefix
|
||||
typed-typed/untyped-prefix
|
||||
untyped-typed/untyped-prefix)
|
||||
|
||||
#|
|
||||
;; test: should work in no-check but not in typed:
|
||||
(typed/untyped-prefix
|
||||
[module moo2 typed/racket]
|
||||
[module moo2 typed/racket/no-check]
|
||||
(: foo One)
|
||||
(define foo 2))
|
||||
|#
|
||||
|
||||
;; define-modules
|
||||
(define-syntax define-modules
|
||||
(syntax-rules (no-submodule)
|
||||
[(_ ([no-submodule] [name lang] ...) . body)
|
||||
|
@ -29,6 +70,7 @@
|
|||
|#
|
||||
|
||||
;; ==== low/require-provide.rkt ====
|
||||
|
||||
(provide require/provide)
|
||||
|
||||
(define-syntax (require/provide stx)
|
||||
|
|
Loading…
Reference in New Issue
Block a user