[racket-dev] Is this a type error?
On Tue, Oct 23, 2012 at 5:14 PM, Danny Yoo <dyoo at hashcollision.org> wrote:
> The following program is generating a type error in 5.3.1, but I don't
> understand it yet.
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;
> #lang typed/racket/base
>
> ;; We may have more information about the lambda's name. This will show it.
> (define-struct: LamPositionalName ([name : Symbol]
> [path : String] ;; the source of the name
> [line : Natural]
> [column : Natural]
> [offset : Natural]
> [span : Natural]) #:transparent)
>
>
> (: current-defined-name (Parameterof (U Symbol LamPositionalName)))
> (define current-defined-name (make-parameter 'unknown))
To add, I can work around this behavior by doing:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(: UNKNOWN Symbol)
(define UNKNOWN 'unknown)
(: current-defined-name (Parameterof (U Symbol False LamPositionalName)))
(define current-defined-name (make-parameter UNKNOWN))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
but I'd still like to know why the earlier code doesn't work in 5.3.1.