Skip to content

Annotating variable failes in match's pattern. #956

Open
@NoahStoryM

Description

@NoahStoryM

What version of Racket are you using?

Racket 7.7-1

What program did you run?

#lang typed/racket
(match '(cond [#t a b c]
              [#f x y z])
  [`(cond [,(? boolean? #{preds : (Listof Boolean)})
           ,(? symbol?  #{bodys : (Listof (Listof Symbol))})
           ...]
          ...)
   bodys])

What should have happened?

In racket:

#lang racket
(match '(cond [#t a b c]
              [#f x y z])
  [`(cond [,(? boolean? preds)
           ,(? symbol?  bodys)
           ...]
          ...)
   bodys])

Output is:

'((a b c) (x y z))

If you got an error message, please include it here.

In typed/racket, it failed:

Type Checker: type mismatch
  expected: (U (List 'a 'b 'c) (List 'x 'y 'z))
  given: (U (List 'b 'c) (List 'y 'z))
  in: (match (quote (cond (#t a b c) (#f x y z))) ((quasiquote (cond ((unquote (? boolean? preds)) (unquote (? symbol? bodys)) ...) ...)) bodys))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions