diff --git a/graph-info.hl.rkt b/graph-info.hl.rkt index ad66945..6fc93ed 100644 --- a/graph-info.hl.rkt +++ b/graph-info.hl.rkt @@ -139,7 +139,7 @@ return the corresponding node can be written based on it. @chunk[ (struct+/contract node-info - ([predicate? identifier?] ;; (expr/τ (→ Any Boolean : ?)) + ([predicate? identifier?] [field-order (listof identifier?)] [fields (hash/c symbol? field-info? #:immutable #t)] [promise-type stx-type/c] diff --git a/graph-type.hl.rkt b/graph-type.hl.rkt index 496aca4..38dc5bf 100644 --- a/graph-type.hl.rkt +++ b/graph-type.hl.rkt @@ -25,12 +25,14 @@ {~seq #:invariant a {~and op {~or ∈ ∋ ≡ ≢ ∉}} b} … {~seq #:invariant p} …)))) - (define-for-syntax compute-graph-info - (syntax-parser - [:signature ])) + (define-for-syntax (compute-graph-info stx) + (parameterize ([disable-remember-immediate-error #t]) + (syntax-parse stx + [:signature + ]))) (define-syntax/parse (define-graph-type . whole:signature) - ;; fire off the eventual errors within macro-expansion. - (compute-graph-info #'whole) + ;; fire off the eventual delayed errors added by compute-graph-info + (lift-maybe-delayed-errors) #`(begin (define-syntax whole.name (compute-graph-info (quote-syntax whole)))))] @@ -86,6 +88,7 @@ @chunk[<*> (require racket/require phc-toolkit + remember (lib "phc-adt/tagged-structure-low-level.hl.rkt") (for-syntax "graph-info.hl.rkt" phc-toolkit/untyped diff --git a/info.rkt b/info.rkt index d81d428..2c035c4 100644 --- a/info.rkt +++ b/info.rkt @@ -13,7 +13,8 @@ "backport-template-pr1514" "typed-map" "scribble-lib" - "pconvert-lib")) + "pconvert-lib" + "remember")) (define build-deps '("scribble-lib" "racket-doc" "remember" diff --git a/test/adt-pre-declarations.rkt b/test/adt-pre-declarations.rkt index a9e55fd..2ec4282 100644 --- a/test/adt-pre-declarations.rkt +++ b/test/adt-pre-declarations.rkt @@ -14,3 +14,4 @@ (remembered! tagged-structure (| Street-incomplete| houses name)) (remembered! tagged-structure (| House-incomplete| owner)) (remembered! tagged-structure (| Person-incomplete| name)) +(remembered! tagged-structure (City name))