racket/typed-racket

case-lambda allows multiple cases with the same arity

開放

#517 建立於 2017年3月24日

 (5 則留言) (0 個反應) (0 位負責人)Racket (106 個分叉)github user discovery
arrowgood first issue

倉庫指標

星標
 (576 顆星)
PR 合併指標
 (平均合併 11天 14小時) (30 天內合併 1 個 PR)

描述

[I originally opened this as an issue for racket, but it more clearly violates the docs for typed/racket.]

Although for racket it doesn't seem explicitly forbidden, the typed/racket docs say:

Note that each formals must have a different arity.

Should this perhaps be an expansion-time error:

> (case-lambda [([z : Zero]) z]
               [([o : One]) o])
- : (-> Zero Zero)

This came up because a student encountering the case-> type constructor wondered whether case-lambda would provide overloading by type.

貢獻者指南