Skip to content

Conversation

@samth
Copy link
Member

@samth samth commented Nov 6, 2017

[(Sequence: (list t))
#:when (subtype t:-Nat t)
;; sequence/c is always a wrapper, so avoid it when we just have a number
(or/sc (flat/sc #'exact-nonnegative-integer?)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should merge #631 first, because with this change and without that PR, every (Sequence T) type in a "trusted positive position" is going to optimize to an any/c contract.

(or/sc (flat/sc ....) (sequence/sc ....))
=>
(or/sc any/c (sequence/sc ....))
=>
any/c

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Even though sequences are read-only, this is a problem if T is something like (Boxof Int))

@pnwamk pnwamk merged commit f35a6fd into racket:master Nov 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants