From c2d9f7ed9a3839b6ec36c21e984600c812b90414 Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Thu, 31 May 2012 08:47:02 -0700 Subject: [PATCH] Attach struct info to constructor for polymorphic TR structs. Closes PR 12806 --- collects/tests/typed-racket/succeed/pr12806.rkt | 12 ++++++++++++ collects/typed-racket/typecheck/tc-structs.rkt | 1 + 2 files changed, 13 insertions(+) create mode 100644 collects/tests/typed-racket/succeed/pr12806.rkt diff --git a/collects/tests/typed-racket/succeed/pr12806.rkt b/collects/tests/typed-racket/succeed/pr12806.rkt new file mode 100644 index 0000000000..7a4149d046 --- /dev/null +++ b/collects/tests/typed-racket/succeed/pr12806.rkt @@ -0,0 +1,12 @@ +#lang racket/load + +(module a typed/racket + (struct: (V) foo ((v : V))) + (provide foo)) + +(module b racket + (require 'a) + + (foo 2)) + +(require 'b) diff --git a/collects/typed-racket/typecheck/tc-structs.rkt b/collects/typed-racket/typecheck/tc-structs.rkt index aca0aaddb1..a5b479ce70 100644 --- a/collects/typed-racket/typecheck/tc-structs.rkt +++ b/collects/typed-racket/typecheck/tc-structs.rkt @@ -240,6 +240,7 @@ (mk/register-sty nm flds parent-name parent-field-types types #:maker maker #:mutable mutable + #:struct-info (syntax-property nm/par 'struct-info) ;; wrap everything in the approriate forall #:wrapper (λ (t) (make-Poly tvars t)) #:type-wrapper (λ (t) (make-App t new-tvars #f))