On Tuesday, May 16, 2017 at 12:47:37 AM UTC-7, kay wrote:
> Hi I feel this might be a bug, can anyone confirm or suggest a fix?
> 
> Here's a minimal usage of `command-line` form:
> 
> ```
> #lang typed/racket
> 
> (define *message* : (Parameterof (Listof String)) (make-parameter '()))
> (define *verbose* : (Parameterof Boolean) (make-parameter #f))
> 
> (define (parse-cmdline)
>     (command-line
>      #:program "q"
>      #:once-each
>      [("-v" "--verbose") "verbose mode" (*verbose* #t)]
>      #:ps "foo bar" ; <---- causing type error
>      #:args #{msg : String} (*message* msg)))
> 
> (parse-cmdline)
> ```
> 
> Note that it gives the below type error[1]. However, if you comment out the 
> line with #:ps, type check passes.
> 
> I noticed that from the error prompt, for argument 3, the expected Union type 
> doesn't include 'ps. This leads me to think it might be a bug. Please tell me 
> it's not and there's a fix:)
> 
> 
> [1]: type error:
> 
> test.rkt:6:0: Type Checker: Polymorphic function `parse-command-line' could 
> not be applied to arguments:
> Argument 1:
>   Expected: Path-String
>   Given:    String
> Argument 2:
>   Expected: (U (Listof String) (Vectorof String))
>   Given:    (Vectorof String)
> Argument 3:
>   Expected: (Listof (Pairof (U 'final 'help-labels 'multi 'once-any 
> 'once-each) (Listof (Listof Any))))
>   Given:    (List (List 'once-each (List (List String String) (-> Any Void) 
> (Listof (List String)))) (List 'ps String))
> Argument 4:
>   Expected: (-> Any a ... a b)
>   Given:    (-> Any String * Void)
> Argument 5:
>   Expected: (Listof String)
>   Given:    (List String)
> 
>   in: (define (parse-cmdline) (command-line #:program "q" #:once-each (("-v" 
> "--verbose") "verbose mode" (*verbose* #t)) #:ps "foo bar" #:args msg 
> (*message* msg)))

Ping... can anyone help with this problem?

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to