diff --git a/collects/typed-racket/rep/type-rep.rkt b/collects/typed-racket/rep/type-rep.rkt index 153c87fd..9e661dee 100644 --- a/collects/typed-racket/rep/type-rep.rkt +++ b/collects/typed-racket/rep/type-rep.rkt @@ -307,7 +307,7 @@ ;; acc-ids : names of the accessors ;; maker-id : name of the constructor (def-type Struct ([name identifier?] - [parent (or/c #f Struct? Name?)] + [parent (or/c #f Struct?)] [flds (listof fld?)] [proc (or/c #f Function?)] [poly? (or/c #f (listof symbol?))] diff --git a/collects/typed-racket/typecheck/signatures.rkt b/collects/typed-racket/typecheck/signatures.rkt index 7f008a6f..8243ba9c 100644 --- a/collects/typed-racket/typecheck/signatures.rkt +++ b/collects/typed-racket/typecheck/signatures.rkt @@ -30,7 +30,7 @@ (define-signature tc-app^ ([cond-contracted tc/app (syntax? . -> . tc-results?)] [cond-contracted tc/app/check (syntax? tc-results? . -> . tc-results?)] - [cond-contracted tc/app-regular (syntax? . -> . tc-results?)])) + [cond-contracted tc/app-regular (syntax? (or/c tc-results? #f) . -> . tc-results?)])) (define-signature tc-apply^ ([cond-contracted tc/apply (syntax? syntax? . -> . tc-results?)])) diff --git a/collects/typed-racket/typecheck/tc-app/signatures.rkt b/collects/typed-racket/typecheck/tc-app/signatures.rkt index ebce2d57..89c6f80c 100644 --- a/collects/typed-racket/typecheck/tc-app/signatures.rkt +++ b/collects/typed-racket/typecheck/tc-app/signatures.rkt @@ -1,11 +1,12 @@ #lang racket/base (require racket/unit "../../utils/utils.rkt" "../../utils/unit-utils.rkt" + syntax/parse/experimental/reflect racket/contract (types utils)) (provide (except-out (all-defined-out) checker/c)) -(define checker/c (syntax? (or/c #f tc-results?). -> . (or/c #f tc-results?))) +(define checker/c reified-syntax-class?) (define-signature tc-app-hetero^ ([cond-contracted tc/app-hetero checker/c])) diff --git a/collects/typed-racket/typecheck/tc-structs.rkt b/collects/typed-racket/typecheck/tc-structs.rkt index e2c3171c..27442973 100644 --- a/collects/typed-racket/typecheck/tc-structs.rkt +++ b/collects/typed-racket/typecheck/tc-structs.rkt @@ -277,7 +277,7 @@ ;; create the actual structure type, and the types of the fields ;; that the outside world will see - (mk/register-sty nm flds parent-name (get-parent-flds parent) types + (mk/register-sty nm flds parent (get-parent-flds parent) types ;; procedure #:proc-ty proc-ty-parsed #:maker maker @@ -295,10 +295,11 @@ (c-> identifier? (or/c #f identifier?) (listof identifier?) (listof Type/c) (or/c #f identifier?) any/c) - (define parent-name (if parent (make-Name parent) #f)) + (define parent-name (and parent (make-Name parent))) + (define parent-type (and parent (lookup-type-name parent))) (define parent-flds (if parent (get-parent-flds parent-name) null)) (define parent-tys (map fld-t parent-flds)) - (define defs (mk/register-sty nm flds parent-name parent-flds tys #:mutable #t)) + (define defs (mk/register-sty nm flds parent-type parent-flds tys #:mutable #t)) (when kernel-maker (register-type kernel-maker (λ () (->* (append parent-tys tys) (lookup-type-name nm))))))