Make struct types overlap with procedures.
Closes PR11971.
This commit is contained in:
parent
5eddac7482
commit
0b87c999b3
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))
|
(and proc (type-rec-id proc))
|
||||||
poly?
|
poly?
|
||||||
pred-id)]
|
pred-id)]
|
||||||
[#:key 'struct])
|
;; This should eventually be based on understanding of struct properties.
|
||||||
|
[#:key '(struct procedure)])
|
||||||
|
|
||||||
;; A structure type descriptor
|
;; A structure type descriptor
|
||||||
;; s : struct
|
;; s : struct
|
||||||
|
|
Loading…
Reference in New Issue
Block a user