<< Back to previous view

[CTYP-121] Type annotation for clojure.core/ex-info forbids nil message argument Created: 14/Mar/14  Updated: 18/Mar/14  Resolved: 14/Mar/14

Status: Closed
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Gordon Syme Assignee: Ambrose Bonnaire-Sergeant
Resolution: Completed Votes: 0
Labels: None


 Description   

The bug here is either in Clojure itself or core.typed, they don't agree on the arguments to clojure.core/ex-info.
I'm reporting it here because I have to pick somewhere

clojure.lang.ExceptionInfo allows null for the exception message, clojure.core/ex-info just passes the arguments straight to the ExceptionInfo constructor so it allows nil for the exception message.

I think the correct type annotation in core/typed/base_env.clj (given how ex-info is implemented) should be:

(ann clojure.core/ex-info (Fn [(Option String) (Map Any Any) -> clojure.lang.ExceptionInfo]
                              [(Option String) (Map Any Any) (Option Throwable) -> clojure.lang.ExceptionInfo]))


 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 14/Mar/14 7:59 AM ]

Fixed https://github.com/clojure/core.typed/commit/926c5a140ecbe33d9ebb5efb37c98d87209121f3

Comment by Gordon Syme [ 18/Mar/14 6:24 AM ]

Awesome, thanks Ambrose

Generated at Mon Dec 22 13:31:14 CST 2014 using JIRA 4.4#649-r158309.