[racket] Getting an expression to type

From: Eric Dobson (eric.n.dobson at gmail.com)
Date: Sun Jan 26 14:31:58 EST 2014

That is definitely a bug, not sure exactly what is going wrong though.
Can you file a bug for this?

In terms of getting your program to run, if you replace '(not
(parameter? p))' with 'number?' it should work.

On Sun, Jan 26, 2014 at 10:08 AM, Spencer Florence <spencer at florence.io> wrote:
> 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
>

Posted on the users mailing list.