Skip to content

Commit 6a042da

Browse files
committed
Make Typed Racket implementation structs authentic.
1 parent 4a9cbf7 commit 6a042da

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

typed-racket-lib/typed-racket/rep/core-rep.rkt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
(begin (struct name ()
7474
#:constructor-name mk
7575
#:transparent
76+
#:authentic
7677
#:property prop:custom-print-quotable 'never
7778
extra ...
7879
#:methods gen:custom-write

typed-racket-lib/typed-racket/rep/free-variance.rkt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
variance:const
4040
variance:dotted)
4141
(let ()
42-
(define-struct Variance () #:transparent)
43-
(define-struct (Covariant Variance) () #:transparent)
44-
(define-struct (Contravariant Variance) () #:transparent)
45-
(define-struct (Invariant Variance) () #:transparent)
46-
(define-struct (Constant Variance) () #:transparent)
42+
(define-struct Variance () #:transparent #:authentic)
43+
(define-struct (Covariant Variance) () #:transparent #:authentic)
44+
(define-struct (Contravariant Variance) () #:transparent #:authentic)
45+
(define-struct (Invariant Variance) () #:transparent #:authentic)
46+
(define-struct (Constant Variance) () #:transparent #:authentic)
4747
;; not really a variance, but is disjoint with the others
48-
(define-struct (Dotted Variance) () #:transparent)
48+
(define-struct (Dotted Variance) () #:transparent #:authentic)
4949
(values Variance? (make-Covariant) (make-Contravariant) (make-Invariant) (make-Constant) (make-Dotted))))
5050

5151
(define (variance:co? x) (eq? x variance:co))
@@ -71,9 +71,9 @@
7171

7272
;;All of these are used internally
7373
;;Only combined-frees is used externally
74-
(struct combined-frees (table computed) #:transparent)
75-
(struct app-frees (name args) #:transparent)
76-
(struct remove-frees (inner name) #:transparent)
74+
(struct combined-frees (table computed) #:transparent #:authentic)
75+
(struct app-frees (name args) #:transparent #:authentic)
76+
(struct remove-frees (inner name) #:transparent #:authentic)
7777

7878

7979
;; Base constructors

typed-racket-lib/typed-racket/rep/rep-utils.rkt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,7 @@
611611
#'(constr-provide nonconstr-provide)])]
612612
[struct-def #'(struct var.name parent ... (flds.ids ...)
613613
maybe-transparent ...
614+
#:authentic
614615
#:constructor-name constructor-name
615616
#:property prop:uid uid-id
616617
#:property prop:mask rep-mask-body

0 commit comments

Comments
 (0)