I'm having difficulty getting the following code to type:

#lang typed/racket
(: test : ((U Number (Parameterof Number)) -> Number))
(define (test p)
  (if (not (parameter? p))
      p
      (p)))

But I get the error:
> Type Checker: Expected Number, but got (U Complex (Parameterof Number))
in: p
On the then branch of the if. Is there a way to convince this to type?

--Spencer
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to