Make struct types overlap with procedures.

Closes PR11971.

original commit: 0b87c999b3113bf378f7c79578a6e65c28e1df67
This commit is contained in:
Eric Dobson 2013-02-17 09:51:57 -08:00
parent 82337641a2
commit 3908da65f5
2 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,14 @@
#lang racket/load
(module a racket
(provide (struct-out foo))
(define-struct foo (proc) #:property prop:procedure (struct-field-index proc)))
(module b typed/racket
(require/typed 'a
(struct foo ((proc : (Number Number -> Number)))))
(if (procedure? (foo +))
#t
(error 'wrong-branch)))
(require 'b)

View File

@ -328,7 +328,8 @@
(and proc (type-rec-id proc))
poly?
pred-id)]
[#:key 'struct])
;; This should eventually be based on understanding of struct properties.
[#:key '(struct procedure)])
;; A structure type descriptor
;; s : struct