
fix case-lambda checking when no expected type Not we will check each clause against the other applicable arrows that are derived during type synthesis for soundness sake. At a future date, if we instead compute a more complete "intersection" of these arrows and then check against that intersection, that would admit more correct programs.
14 lines
453 B
Racket
14 lines
453 B
Racket
#;
|
|
(exn-pred 3)
|
|
#lang typed-scheme
|
|
|
|
(plambda: (a ...) ([z : String] . [w : Number *])
|
|
(apply (case-lambda: (([x : Number] . [y : Number ... a]) x))
|
|
w))
|
|
|
|
(plambda: (a ...) ([z : String] . [w : Number *])
|
|
(apply (case-lambda: (([x : Number] . [y : Number ... a]) x)
|
|
(([x : String] [y : String] . [z : String *]) 0)
|
|
([y : String *] 0))
|
|
w))
|