Make struct types overlap with procedures.
Closes PR11971. original commit: 0b87c999b3113bf378f7c79578a6e65c28e1df67
This commit is contained in:
parent
82337641a2
commit
3908da65f5
14
collects/tests/typed-racket/succeed/pr11971.rkt
Normal file
14
collects/tests/typed-racket/succeed/pr11971.rkt
Normal 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)
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user