[racket] Getting an expression to type
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
>