“n”在Typed Racket中是什么意思?

问题描述

n错误消息的类型级别显示,它是什么?

示例:

(: trick (All (t u) ((U t (listof u))  -> (listof u)))) 
(define (trick x)
    (cond
      [(list? x) x]
     )      
)

n 类型的错误

Type Checker: type mismatch
  expected: (listof u)
  given: (U (listof u) (∩ (Pairof Any (listof Any)) t)) in: x

我尝试用 n 编写类型签名,并在 Dr. Racket 中使用 go-to-deFinition,但它说找不到符号。

解决方法

不是n,而是 (intersection)

Thanks @willness@molbdnilo