[racket-dev] Is this a type error?

From: Danny Yoo (dyoo at hashcollision.org)
Date: Tue Oct 23 19:14:58 EDT 2012

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))
;;;;;;;;;;;;;;;;;;;;;;;;;;;


I see the following error message:

    . Type Checker: Expected (Parameterof (U Symbol
LamPositionalName)), but got (Parameterof (U Symbol LamPositionalName
'unknown)) in: (make-parameter (quote unknown))


which I didn't expect because 'unknown should be a symbol.

Posted on the dev mailing list.